Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

MainLauncher Activity each time creating new instance of the Activity & not loading from memory

$
0
0

I am having below code in my Main Launcher activity. My problem is at first time while launching the app, MainActivity was created, but if am going to android home screen or starting some other app, and if i came back & touches the app icon means again it creating the activity instead of restarting it. I want it to retain the previous state and restart the activity, once if the Activity is being created.

    [Activity (Label="Notes", MainLauncher=true, AlwaysRetainTaskState = true, LaunchMode = Android.Content.PM.LaunchMode.SingleInstance, Theme = "@style/Theme.AppCompat")]            
        [MetaData("android.support.UI_OPTIONS", Value = "splitActionBarWhenNarrow")]
        public class NotesList :  ActionBarActivity
        {
        }

I added AlwaysRetainTaskState = true, LaunchMode = Android.Content.PM.LaunchMode.SingleInstance these attributes for retaining the previous state, but no response.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>