I have created an android program which has 5 activities?
- Main activity from there I get into Login activity
- Login activity to Activity A
- Activity A to Activity B
- Activity B to C Activity or D Activity
- C Activity or D Activity to Main Activity
I know I have to put a finish() for all the activity but the problem is that I don’t want put a finish() before all new activities instead is there way to finish all running activities in main screen by a click of a button along with main screen activity?
Use
android.os.Process.killProcess(android.os.Process.myPid());
This will close your application