Home > DeveloperSection > Forums > How to perform action in android hardware back button?
Kamlakar Singh
Kamlakar Singh

Total Post:194

Posted on    November-15-2014 3:32 AM

 Android Android sdk 

 1 Reply(s)
 699  View(s)
Rate this:
 perform action in android hardware back button

sandy taylor
sandy taylor

Total Post:46

Posted on    November-15-2014 6:59 AM

    This  is code of android hardware back button. Here you can perform your action


public boolean onKeyDown(int keyCode, KeyEvent event)  {

    if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.ECLAIR

            && keyCode == KeyEvent.KEYCODE_BACK


// your code here



    return super.onKeyDown(keyCode, event);


Don't want to miss updates? Please click the below button!

Follow MindStick