I want to kill application. I used:
android.os.Process.killProcess(android.os.Process.myPid());
and
System.exit(0);
it only kills current Activity and not the whole application.
I want to kill application. I used:
android.os.Process.killProcess(android.os.Process.myPid());
and
System.exit(0);
it only kills current Activity and not the whole application.
System.exit() does not kill your app if you have more than one activity on the stack. What actually happens is that the process is killed and immediately restarted with one fewer activity on the stack.
The answer is already here.
You should set FLAG_ACTIVITY_CLEAR_TOP in the Intent to kill all the activities in stack.It will close all the activities and also the app.