android 完美退出应用程序。

  Intent intent = new Intent(Intent.ACTION_MAIN); 
                         intent.addCategory(Intent.CATEGORY_HOME); 
                         intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
                         startActivity(intent); 
                     android.os.Process.killProcess(android.os.Process.myPid());

猜你喜欢

转载自liuguofeng.iteye.com/blog/2105263