How to disabled back button in android

Total Post:61


 1290  View(s)
Rate this:
How to disabled back button in android?
  1. Re: How to disabled back button in android

    Basically android back button has override method or event. You can handle back button action according to your need on this event; Paste the following code in your Activity and Now your back button is disabled.

        public boolean onKeyDown(int keyCode, KeyEvent event) {
             if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
                 if (keyCode == KeyEvent.KEYCODE_BACK) {
    // return super.OnKeyDown(KeyCode,event);
    // This code will stop your back button work
             return false;

      Modified On Apr-09-2018 01:29:41 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.