I want to click a button in an android application to kill all services and activities and launch the entire application. I tried the following two codes. After execution, it can be launched, but some mobile phones prompt that it is abnormal. The "App has stopped running" prompt is launched.
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
How to write?
我想大声告诉你2017-05-16 13:27:58
Just manage the Activity stack well
There is no need to use this forced exit method android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
滿天的星座2017-05-16 13:27:58
You can refer to how to exit the service, and call stopService where needed