January 23, 2011

[SOLVED] Android: Override back button


@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
   
if (keyCode == KeyEvent.KEYCODE_BACK) {
        //do some stuff

       
return true;
   
}
   
return super.onKeyDown(keyCode, event);
}

 

Source: stackoverflow.com.

No comments:

Post a Comment