hi guys after i call the method onKeyDown and my app closes without get me back error, this my code:
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK)
{
if (expList.getVisibility() == View.VISIBLE){
expList.setVisibility(View.INVISIBLE);
}else{
//
}
}
return super.onKeyDown(keyCode, event);
}
your app closes because you call the method “super.onKeyDown(keycode, event);”
Try in using a return false like this :
public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if (expList.getVisibility() == View.VISIBLE){ expList.setVisibility(View.INVISIBLE); }else{ // } } return false; }