Search...

Monday, February 27, 2012

How to go to home activity by removing the in between activities on the stack in android??


Suppose you user went to A->B->C->D activities and now user wanted to again come to activity A(HomeActivity)from D activity. Use the following code.

            Intent intent = new Intent(this, HomeActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intent);

No comments:

Post a Comment