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
Way One
Way Two
Your answer helped me, Pentium10, but I needed to do one more thing :
I had to clear(close) all my previous activities with
This means: every activity, started after FirstActivity, is closed. (In other words, this cleans the activity stack above FirstActivity). Then all I have to do is finish my FirstActivity.
Close all the previous activities as follows:
Then in MainActivity onCreate() method add this to finish the MainActivity