Android Programming: Close entire App
Question by Guest | Last update on 2021-05-12 | Created on 2016-06-12
I am searching for a Java command for Android with which I can quit and exit my whole app programmatically.
Up to now, I have always used finish(), but this function only seems to close the current activity and not all of the application.
What can I do if my app is consisting of multiple activities?
Related Topics
Android Splash Screen Tutorial
Tutorial | 0 Comments
Android Table Layout with columns of equal width
Tutorial | 0 Comments
Android Getting Sound Levels
Open Question | 1 Answer
WhatsApp - It was a beautiful time
Article | 0 Comments
Android SDK Manager: Problem with installing packages "File not Found (Access is denied) Done. Nothing was installed"
Question | 4 Answers
Android Programming: Dial and Call Telephone Number
Tutorial | 0 Comments
Android Programming: Open URL/Set Link to Website
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
If you want to work with finish(), you have to call finish() for each activity individually to close all.
To close all activities at once, you can use the following line since API 16:
With this, you are closing the current activity as well as all activities below in the same task having the same affinity.
By the way, the android developers have not necessarily intended that someone is about to exit an app via code. Instead, this should handle and manage the system.
Last update on 2021-05-12 | Created on 2016-06-13