How to perform action in android hardware back button?

Total Post:194

Points:1396
 1333  View(s)
Ratings:
Rate this:
 perform action in android hardware back button
  1. Post:46

    Points:324
    Re: How to perform action in android hardware back button?

        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);
    }

      Modified On Apr-06-2018 06:18:44 AM

Answer