0

In an activity i need to clear the stack i.e on clicking back it should go to home page of device and clear the stack of activities. I am using following code:

    Intent intent = new Intent(Intent.ACTION_MAIN);
            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            intent.addCategory(Intent.CATEGORY_HOME);
            startActivity(intent);

It is coming to home screen but when the icon of app is clicked again it does not go to login page i.e. the first screen instead goes to second screen. What to do to resolve the issue. Thanks

ekjyot
  • 2,247
  • 7
  • 39
  • 63

1 Answers1

2

I think your question is similiar with this one and I have answered there. FLAG_ACTIVITY_CLEAR_TOP is not the way that you are thinking of.

Community
  • 1
  • 1
Huang
  • 4,812
  • 3
  • 21
  • 20
  • now that problem got solved but a loader starts loading on the login page itself but it should load only when some proccessing is there.How to resolve this issue – ekjyot Dec 09 '11 at 10:24
  • I have improved my answer, and I think I don't catch. Could you explain you question more clearly? Sorry – Huang Dec 09 '11 at 13:33