Пример #1
0
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   if (keyCode == KeyEvent.KEYCODE_BACK) {
     if (!isExit) {
       isExit = true;
       IocContainer.getShare().get(IDialog.class).showToastShort(self, "再按一次退出程序");
       mHandler.postDelayed(new ExitRunnable(), 2000);
     } else {
       Intent it = new Intent(self, MsgService.class);
       stopService(it);
       ActivityTack.getInstanse().exit(self);
     }
     return false;
   }
   return super.onKeyDown(keyCode, event);
 }