Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quitting application in Android

Tags:

android

I want to quit application in Android. Just put a "quit" button, which kills my app.

I know I shouldn't do this. I know that this is not the philosophy of the OS.

If you know how it can be done, pls share.

In the app, I have many opened activities, so "finish()" will not do the job.

Thank you for your information in advance. Danail

like image 727
Danail Avatar asked Oct 15 '25 21:10

Danail


1 Answers

Way One

android.os.Process.killProcess(android.os.Process.myPid())  

Way Two

System.exit(0);  
like image 106
Pentium10 Avatar answered Oct 18 '25 10:10

Pentium10



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!