We know that on back press of button in any android application can finish the app or an activity but some process of application still works in background so if you want to kill all the processes of any application you can kill app process like this :
@Override
public void onBackPressed() {
android.os.Process.killProcess(android.os.Process.myPid());
}
Here method killProcess kill the process with the given package id. so this method allows us to request to kill any process based on its package id but the kernel will still impose some restrictions on some pid.
0 Comment(s)