在共享选项列表中单击应用程序后导航到主页吗?

在共享选项列表中单击我的应用程序后,我试图导航回主页。

这是我的主页:https : //gyazo.com/831db63433d9b3e2051ed605dc3489af

当我在此处的共享选项列表中单击我的应用程序时:https : //gyazo.com/47234162530078e1a83cdfb17eaf5401

我来到此页面:https : //gyazo.com/11cfb0f6818127e2cd4ef51d5ed970b9

但是,当我在共享选项列表中单击我的应用程序时,我想导航至图片1。我怎样才能做到这一点?如图所示,共享意图活动位于AndroidManifest.xml中。图一中显示的页面称为“ TabbedPagePage”,这是我首先尝试访问的页面,而没有看到这个丑陋,没有内容的深色图片。


德玛西亚99
浏览 149回答 1
1回答

汪汪一只猫

似乎您需要IntentFilter为自己设置,MainActivity而不是使用其他活动。它将最终导航到主页。例如:    [Activity(Label = "Navigatetomainpage", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]    [IntentFilter(new[] { Intent.ActionSend }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = "image/*", Label = "Navigatetomainpage")]    [IntentFilter(new[] { Intent.ActionSend }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = "text/plain", Label = "Navigatetomainpage")]    [IntentFilter(new[] { Intent.ActionSendMultiple }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = "image/*", Label = "Navigatetomainpage")]        public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity    {        protected override void OnCreate(Bundle bundle)        {               Intent intent = Intent;            String action = Intent.Action;            String type = intent.Type;            if (Intent.ActionSend.Equals(action) && type != null)            {                if ("text/plain".Equals(type))                {                    // Handle text being sent                    // ...                    // ...                    // ...                }                else if (type.StartsWith("image/"))                {                    // Handle single image being sent                    // ...                    // ...                    // ...                    }            }            else if (Intent.ActionSendMultiple.Equals(action) && type != null)            {                if (type.StartsWith("image/"))                {                    // Handle multiple images being sent                    // ...                    // ...                    // ...                                        }            }            else            {                // Handle other intents, such as being started from the home screen                                }                TabLayoutResource = Resource.Layout.Tabbar;            ToolbarResource = Resource.Layout.Toolbar;            base.OnCreate(bundle);            global::Xamarin.Forms.Forms.Init(this, bundle);            LoadApplication(new App());        }    }
打开App,查看更多内容
随时随地看视频慕课网APP