Android‎ > ‎

Home Action on Back Button

posted Apr 10, 2013, 1:42 AM by Akash Khaitan
Just use the below method which would make the back button to perform like home button of Android

   @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            moveTaskToBack(true);
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }


Comments