App completely restarting when launched by icon press in launcher

前端 未结 14 2084
灰色年华
灰色年华 2020-11-29 03:02

I\'m in the process of trying to make a release build of my first android app to send to a few testers. However, I ran into a problem with it. When you exit the app and then

14条回答
  •  抹茶落季
    2020-11-29 03:51

    For me the fix was adding LaunchMode = LaunchMode.SingleTop to my Activity attribute over the Main Activity:

    /// 
        /// The main activity of the application.
        /// 
        [Activity(Label = "SilhuettePhone",
            Icon = "@drawable/icon",
            Theme = "@style/MainTheme",
            MainLauncher = true,
            ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
            ScreenOrientation = ScreenOrientation.Portrait,
            LaunchMode = LaunchMode.SingleTop,
            WindowSoftInputMode = SoftInput.AdjustResize)]
    

提交回复
热议问题