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

Total Post:194

Points:1396
Posted on    November-15-2014 3:32 AM

 Android Android sdk 
Ratings:


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


sandy taylor
sandy taylor

Total Post:46

Points:324
Posted on    November-15-2014 6:59 AM

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

@Override

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