Skip to content Skip to sidebar Skip to footer

How To Override Android Keyboard

How we can override the Android keyboard in all activities on Android? I am using it like this @Override public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent ev

Solution 1:

Please note following points:

  • With code you posted above, you cannot handle all the keys like Home Key.
  • This method will work for only one activity which is visible and not for all the activities of your application where you are trying to show dialog.
  • If you want to listen to keypress event in all activities, then you have to do something. Something like send broadcast which is a bad idea.

So its better to optimize your logic.

Post a Comment for "How To Override Android Keyboard"