Problems launching the app from “recent apps” and tapping app icon homescreen

ephramdephramd ESMember ✭✭

I have an application that starts with a "SplashScreen" and when it finishes it goes to "MainScreen".

I am on "MainScreen" and I click on the home button:

CASE 1. I click on "Overview" (the button that shows the recent apps) and I click on my application and simply continue where it was, ie on MainScreen.

CASE 2. But If I click on app icon from desktop/home screen this launches the application from zero, ie calls SplashScreen.

I want it if I hit the icon from desktop this call the last activity as it does "recent apps.

SPLASHSCREEN:

[Activity(MainLauncher = true, LaunchMode = LaunchMode.SingleInstance,ClearTaskOnLaunch = true,

        AlwaysRetainTaskState = false, ExcludeFromRecents = true, NoHistory = true, 
        Label = "MyApp", ScreenOrientation = ScreenOrientation.Portrait, Theme = "@style/Theme.FullScreen", Icon = "@drawable/icon")]

I call "MainScreen" like this:

Intent intent = new Intent(Application.Context, typeof(MainActivity));
                intent.SetFlags(ActivityFlags.ClearTask);
                StartActivity(intent);
                OverridePendingTransition(Resource.Animation.fade_in_animation, Resource.Animation.fade_out_animation);
                this.Finish();
                OverridePendingTransition(Resource.Animation.fade_in_animation, Resource.Animation.fade_out_animation);

And MainScreen:

[Activity(MainLauncher = false, LaunchMode = LaunchMode.SingleTask,
        AlwaysRetainTaskState = true, ExcludeFromRecents = false, NoHistory = false,
        Label = "MyApp", ScreenOrientation = ScreenOrientation.Portrait, Icon = "@drawable/icon", Theme = "@style/Theme.FullScreen")]
Sign In or Register to comment.