完全退出android程序
2013-11-28 00:00
218 查看
int currentVersion = android.os.Build.VERSION.SDK_INT; if (currentVersion > android.os.Build.VERSION_CODES.ECLAIR_MR1) { Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(startMain); System.exit(0); } else {// android2.1 ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE); am.restartPackage(getPackageName()); }
已经不知道出处了,这只是我的个人记录
相关文章推荐
- android实现完全退出程序
- Android开发中完全退出程序的三种方法
- 独辟蹊径之android程序完全退出的一种途径
- Android程序完全退出的解决方案
- Android完全退出程序
- Android应用开发完全退出程序的通用方法!!! (转)
- Android完全退出多个activity程序设计
- android程序完全退出步骤
- Android中完全退出程序的四种方法
- Android 完全退出程序的方法
- Android完全退出程序
- android 2.2 完全 退出 ---程序代码
- Android企业级程序完全退出的解决方案
- Android开发中完全退出程序的三种方法
- Android开发中完全退出程序的三种方法
- 让Android点击通知栏信息后返回正在运行的程序,并完全退出所有activity
- 完美解决Android完全退出程序(转)
- Android 完全退出程序
- Android程序完全退出的三种方法
- Android程序完全退出的三种方法