|
|
|
|
|
-
-
-
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent event) {
-
- if(keyCode == KeyEvent.KEYCODE_BACK)
- {
- exitBy2Click();
- }
- return false;
- }
-
-
-
- private static Boolean isExit = false;
-
- private void exitBy2Click() {
- Timer tExit = null;
- if (isExit == false) {
- isExit = true;
- Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
- tExit = new Timer();
- tExit.schedule(new TimerTask() {
- @Override
- public void run() {
- isExit = false;
- }
- }, 2000);
-
- } else {
- finish();
- System.exit(0);
- }
- }
发表于
2013-11-14 15:03
♂小旭
阅读( 217)
评论()
编辑
收藏
举报
|
|