3

I'm building application for blind people to use android devices. For that I want to disable hardware buttons without power button. I tried to do that with code

      @Override
       public boolean onKeyDown(int keyCode, KeyEvent event) {

          if (keyCode == KeyEvent.KEYCODE_BACK) {
            return false;
         }
         if (keyCode == KeyEvent.KEYCODE_MENU) {
            return false;
           }
           if (keyCode == KeyEvent.KEYCODE_HOME) {
             return false;
           }
          if (keyCode == KeyEvent.KEYCODE_SEARCH) {
                  return false;
             }
          if (keyCode == KeyEvent.KEYCODE_SETTINGS) {
            return false;
          }

           return super.onKeyDown(keyCode, event);
       }

I'm using android Kitkat.please try to answer for this without adding negative for this question.thank you.

Talha Q
  • 4,350
  • 4
  • 28
  • 40

0 Answers0