[英]Going Back To Main App After Launching Intent Xamarin.Android
I have an android app I am developing on Visual Studio Xamarin.Android In my app I create a .pdf file and launch any .pdf apps using an intent. 我有一个要在Visual Studio Xamarin.Android上开发的Android应用程序。在我的应用程序中,我创建一个.pdf文件并使用意图启动任何.pdf应用程序。 Code Below... 下面的代码...
Android.Net.Uri uri = Android.Net.Uri.FromFile(file);
Intent intent = new Intent(Intent.ActionView);
intent.SetDataAndType(uri, application);
intent.SetFlags(ActivityFlags.TaskOnHome | ActivityFlags.NewTask );
StartActivity(intent);
My question is: When I click the back button on the application I opened using the intent, it goes to the android home screen. 我的问题是:当我单击使用意图打开的应用程序上的后退按钮时,它将转到android主屏幕。 How do I make it go back to the application it was launched from? 如何使它返回到从其启动的应用程序?
使用StartActivityForResult
和OnActivityResult
http://developer.android.com/training/basics/intents/result.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.