I am working on Android applications and getting one problem. I am using Exit Button, so when I am clicking the exit button (which is present in last activity of the application or in Middle but not in First Activity) then the application should close, and when I am restarting the application it should start from the first screen.
But my problem is it's not killing the application and when I am starting again it is starting from the previously paused activities.
I have used System.exit(0)
and also used android.os.Process.killProcess(android.os.Process.myPid())
.
but those are not working.