Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to shutdown an android application?

How to shutdown an android application? I don't find a shutdown command to application object. I want to shutdown and restart in case of some critical error.

like image 461
Jais Joy Avatar asked Oct 29 '25 20:10

Jais Joy


2 Answers

If there is some kind of "critical error", then you should should deal with it in your code rather then trying to restart the application.

You cannot shutdown an application in Android, however once all of your Activities are closed (which you can programatically do with the Activity.finish() method), then your application is considered to be closed.

like image 112
Eric Levine Avatar answered Nov 01 '25 09:11

Eric Levine


You don't need to shutdown an application, Android takes care of this.

The application is on the background and she is "freezed". If the system, or another application needs memory or CPU, Android will choose a background application to stop.

But everything is automatic. It's the Android's power !

like image 21
Gp2mv3 Avatar answered Nov 01 '25 09:11

Gp2mv3



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!