HOW TO DISABLED BACK BUTTON IN ANDROID

Brad Pitt

Total Post:61

Points:429
Posted by  Brad Pitt
 767  View(s)
Ratings:
Rate this:
How to disabled back button in android?
  1. lois waisbrooker

    Post:70

    Points:494
    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.

    @Override

        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;

        }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!