Android : How to kill process after my android app exit?

on Friday, September 26, 2014


After I pressed back key to exit my android app, the process of this app still exists:



$ adb shell ps |grep -is accelerometerplay
u0_a122 2679 139 504048 23968 ffffffff 400d13c4 S com.example.android.accelerometerplay


I add some code in onDestroy():



@Override
public void onDestroy() {
super.onDestroy();

android.os.Process.killProcess(android.os.Process.myPid());
}


Is this enough? Or I have to do some extra things?


0 comments:

Post a Comment