我有2个活动,都标记为MainLauncher = true,这是期望的行为 - 我希望在安装时在设备上有2个应用程序快捷方式。 在开发过程中,我想选择在调试此应用程序时始终显示的特定活动。我使用Visual Studio 2015更新3,最新的Xamarin.Android
[Activity(Label = "Activity 1", MainLauncher = true, Icon = "@drawable/iconMain"]
...
[Activity(Label = "Activity 2", MainLauncher = true, Icon = "@drawable/iconMain"]
...
答案 0 :(得分:0)
您可以使用#if
仅在调试模式下显示第二个活动:
#if DEBUG
[Activity(Label = "Activity 2", MainLauncher = true, Icon = "@drawable/iconMain"]
#else
[Activity(Label = "Activity 2", MainLauncher = false, Icon = "@drawable/iconMain"]
#end if