In onKeyDown() method:
System.gc();
// System.exit(0);
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
activityManager.killBackgroundProcesses(getPackageName());
android.os.Process. killProcess(android.os.Process.myPid());
there is always one that belongs to you~
Summary of killing process scheme when Android exits the application
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326152399&siteId=291194637
Ranking