MainLauncher = true,
⼀一、Xamarin.Android隐藏应⽤用图标的⽅方式
1、Xamarin.Android启动Activity的
类“BoowaySurveyApp\BoowaySurveyApp.Droid\SplashActivity.cs”,指定
Name
[Activity(
Name = "pwkc.SplashActivity",
Label = "@string/ApplicationName",
Theme = "@android:style/Theme.Light.NoTitleBar",
NoHistory = true,
ScreenOrientation = ScreenOrientation.Portrait,
ConfigurationChanges = ConfigChanges.ScreenSize |
ConfigChanges.Orientation
)]
2、在AndroidManifest.xml添加以下代码,参
考http://www.mamicode.com/info-detail-2167068.html
3、Xamarin.Android调起隐藏应⽤用的代码
Intent intent = new Intent();
ComponentName componentName = new
ComponentName("com.booway.pwkc", "pwkc.SplashActivity");
intent.SetComponent(componentName);
var uri = Android.Net.Uri.Parse("pwkc.SplashActivity");
intent.SetData(uri);
// ⾮非隐藏应⽤用调⽤用⽅方式
//Intent intent =
this.PackageManager.GetLaunchIntentForPackage("com.booway.pwkc");
//intent.AddCategory(Intent.CategoryLauncher);
//intent.SetAction(Intent.ActionMain);
this.StartActivity(intent);
参考资料料:
1、An Introduction to Xamarin.Forms:
http://www.cnblogs.com/yuzukwok/p/3884377.html
2、Xamarin Forms: PCL vs. Shared Project
http://hotkrossbits.com/2015/05/03/xamarin-forms-pcl-vs-shared-project/
⼆二、Xamarin.Android启动第三⽅方应⽤用
// 定义通讯组件
Intent intent =
currentActivity.PackageManager.GetLaunchIntentForPackage("c
om.booway.map");
// 执⾏行行动作
intent.AddCategory(Intent.CategoryLauncher);
intent.SetAction(Intent.ActionMain);
intent.PutExtra("toolType", toolType);
intent.PutExtra("userId", userId);
intent.PutExtra("projectId", projectId);
currentActivity.StartActivity(intent);