[Android] 뒤로가기(BackButton) 두번 눌러서 앱 종료!
//BackButton private final longFINSH_INTERVAL_TIME = 2000; private longbackPressedTime = 0; @Override public void onBackPressed() {long tempTime = System.currentTimeMillis();long intervalTime = tempTime - backPressedTime; if ( 0 = intervalTime ) {super.onBackPressed(); } else { backPressedTime = tempTime; Toast.makeText(getApplicationContext(),"두번 눌러",Toast.LENGTH_SHORT).show(); } }
2014.07.31