Closing several android activities simultaneously

Posted by teedyay on Stack Overflow See other posts from Stack Overflow or by teedyay
Published on 2010-03-17T11:56:32Z Indexed on 2010/03/17 12:01 UTC
Read the original article Hit count: 211

Filed under:

In my application you can navigate through several Activities until the Activity stack is quite deep.

We'd like a button on every Activity that will take you straight back to the main menu - i.e. pop all Activities from the stack except the first one.

I've put the button in a View that I can easily put on every Activity in the application, but I can't figure out how to close several Activities in one fell swoop.

(If possible, it would be good if the View could work out how many Activities to close by itself - i.e. detect how deep on the stack its own Activity is.)

© Stack Overflow or respective owner

Related posts about android