Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Android, what's the difference between force stop and kill process

In Android Studio, I can terminate a process. I can also kill process by using the kill command. So I want to know what the exact meanings are of the below methods:

  1. Terminate foreground application by Android Studio
  2. Terminate background application by Android Studio
  3. Remove app from recent app list
  4. Force stop the app through setting
  5. Kill process though kill command

and how to write a robust app to make sure the app will not have any crash problems when the app has been killed by the user or the system. Thanks.

like image 653
XWang Avatar asked Nov 11 '22 20:11

XWang


1 Answers

Yes. In DDMS, "Stop Process" kills the process. With "Force Stop", not only is the process killed, but it is moved into the "stopped" state, where nothing in that app will run again until somebody manually runs one of that app's components (typically: the user launches an activity from the home screen).

You can read more about the stopped state in the Android 3.1 documentation.

like image 200
Ankit Avatar answered Nov 15 '22 05:11

Ankit