Have the system perform a force stop of everything associated with the given application package. All processes that share its uid will be killed, all services it has running stopped, all activities removed, etc. In addition, a ACTION_PACKAGE_RESTARTED broadcast
will be sent, so that any of its registered alarms can be stopped, notifications removed, etc.
You must hold the permission RESTART_PACKAGES to be able to call this method.
The name of the package to be stopped.
[java] final ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
final ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
public static final void killProcess (int pid)
Kill the process with the given PID. Note that, though this API allows us to request to kill any process based on its PID, the kernel will still impose standard restrictions on which PIDs you are actually able to kill. Typically this means only the process
running the caller's packages/application and any additional processes created by that app; packages sharing a common UID will also be able to kill each other's processes.
public void finish ()
Call this when your activity is done and should be closed. The ActivityResult is propagated back to whoever launched you via onActivityResult().