I want close android app
int id= android.os.Process.myPid();
android.os.Process.killProcess(id);
This code kills the Process.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you always want your app to start with the root activity (the first activity) every time the user launches the app from the home screen or returns to it from the list of recent apps, then add this to the manifest in the
<activity>tag for your root activity:However, if you want to just finish all activities in the current task you can do the following:
This will cause all activities in the task to be finished and it will create a new instance of
MyRootActivity. InMyRootActivity.onCreate()do the following: