1. Call the shell command to kill the process by getting the current process ID.
int pid = Android.os.Process.myPid ();
String command = "kill-9" + process.mypid ();
try {
Runtime.getruntime (). exec (command);
} catch (IOException e) {
TODO auto-generated Catch block
E.printstacktrace ();
}
2. Call the system's method to kill the process,
Android.os.Process.killProcess (Android.os.Process.myPid ());
3. Get the package name and restart the app
Activitymanager am = (activitymanager) getsystemservice (Activity_service);
Am.restartpackage ("COM.ANDROID.NFC");
4. Call the system's interface and exit the app.
System.exit (0);
5. Restart your app's activity
Intent k = Mcontext.getpackagemanager ()
. Getlaunchintentforpackage ("COM.ANDROID.NFC");
K.addflags (Intent.flag_activity_clear_top);
Mcontext.startactivity (k);
Android app Kill, restart, restart, method