0

Using log.d and a function as :

@Override
public void onBackPressed(){
    Log.d("back","back");
    }
}

It seems, the button to minimize the keyboard is not recognized as the back button. Is there a workaround to find a keyID for this button, or does it actually exist and am I doing something wrong?

Device Used : Xperia Z1 C6902

1 Answers1

1

Use this method

protected boolean onKeyDown(int keyCode, KeyEvent event) {
     if (keyCode == KeyEvent.KEYCODE_BACK) {
        // do whatever you want to do
        return true;
     }
     return false;
 }

Refer Back and other keys. But if onBackPressed is not working, also try to implement onKeyDown method where you handle keycode for back.

Akshay Deo
  • 528
  • 1
  • 6
  • 22
  • It still does not recognize the minimize button as a back button keypress. The minimize button in reference here is the one circled in : http://i.imgur.com/bZ55FWn.jpg – Mayur Mohan Jun 23 '14 at 03:09