退出应用程序 按两次退出键

 /**
  * 退出应用程序 按两次退出键
  */
 private void exitApp() {
  // TODO Auto-generated method stub
  // 判断2次点击事件时间
  if ((System.currentTimeMillis() - exitTime) > 2000) {
   Toast.makeText(this, "再按一次退出摇乾树", Toast.LENGTH_SHORT).show();
   exitTime = System.currentTimeMillis();
  } else {
   // finish();
   Sys.Lib_PowerOff();
   AppManager.getAppManager().exitApp(this);
  }
 }

原文地址:https://www.cnblogs.com/childhooding/p/4469019.html