Terminate all activities

mrjaw

Active Member
Licensed User
Longtime User
Hi!
I have an app that open few activities when I quit of app I need to finish all activities.

How can I finish all activities?

I know that I can use Activity.finish but how can I use it from other activity
?
 

mc73

Well-Known Member
Licensed User
Longtime User
Keeping activities 'open' can become messy, to not mention the memory waste done. Actually, I've tried it some times, but in the end they brought more problems than the ones solved.
Thus, I would recommend following NJDude's advice. However, if you insist on not using activity.finish, you could declare a process_global boolean variable, as closeAllActivities. When set to true, you would use activity.finish in the activity_resume sub of the activities which are needed to be closed.
 
Upvote 0
Top