Android 退出应用时杀死进程方案总结

        在onKeyDown()方法里:
                System.gc();
//              System.exit(0);
                ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
                activityManager.killBackgroundProcesses(getPackageName());
                android.os.Process.killProcess(android.os.Process.myPid());


总有一种属于你~

猜你喜欢

转载自lqz678.iteye.com/blog/2383352