`
用牛奶把自己灌醉
  • 浏览: 12501 次
社区版块
存档分类
最新评论

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());


总有一种属于你~
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics