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

Clearing Android activities stack

$
0
0

Hi,
I have home screen in my application, from which user shall navigate to different module by tapping module icons on home screen. Each module has set of activities( drill down screens). Each screen shall have home button for navigating to home screen directly at any point of time.

The expected behavior on tap home button is activities stack has to be cleared so that on back press, previous activity should not be displayed.
So I used the below code

          //home button click navigate to home screen
    _btnHome.Click += (sender, e) => {
            Intent intent = new Intent (activity, typeof(HomeActivity));
            intent.AddCategory (Intent.CategoryHome);
            intent.SetFlags (ActivityFlags.ClearTop | ActivityFlags.NewTask);
            activity.StartActivity (intent);
    };

But on back press, still I am able to see previous screen, which means the activity stack is not cleared.

Kindly need your help for resolving this issue.

Thanks in advance,


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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