Wednesday, 7 August 2013

Destroy an activity when back button is pressed?

Destroy an activity when back button is pressed?

I have an app that allows user to select a txt file from a list and then
goes off to the internet to get the contents of that file. All works well
except when the user accidentally or deliberately presses the hardware
back button to go and see the list again.
Now, when the user clicks a new item from the list (a new file that is),
instead of loading a the new file, the app continues off from where it was
suspended.I do not want that to happen. I know this is related to the life
cycle of the activity.
How do I make sure that it loads the new file rather than continuing from
where it left off ?

No comments:

Post a Comment