I have opened 3 activities. Now the user want to exit the application. for that I have to finish all the activities. It is not recommended to do this but My application wants to provide such an exit point to user. How to close application when multiple activities are alive
Thanks
All actrivities of any application use the same process id in android. that means only one activity stay at th top and that activity share the same process which was created by other activity. so killing an process id is same as finish() on activity.
If you have called Activity B from activity A. when activty B is killed then your control comes to onResume() method of activity A.
you can use this behaviour.
let you have created a button on click of which you will exit the application. to achieve this. set a static boolean value on click of that method. andr finish the activity.
Now in every class which extends Activity override
onResume()as followsIn this way you can exit an application
Thanks
Deepak