How to launch app on android?
巴扎黑
巴扎黑 2017-05-16 13:25:58
0
3
591

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?

巴扎黑
巴扎黑

reply all(3)
我想大声告诉你

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);

阿神

How to terminate the background service correctly

滿天的星座

You can refer to how to exit the service, and call stopService where needed

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!