Disable the return key for android details
In today's project, you need to use the return key in your own actionBar. The method used is the method of My Father activity recorded last time.
Android. support. PARENT_ACTIVITY
For more information, see: http://blog.csdn.net/yiding_he/article/details/38410151
(Menu in android details: invalidateOptionsMenu)
The problem today is to disable the system's return key. to disable the home Key, permission is required, and the user experience is insufficient. So in the project, we can disable the system return key to prevent sudden user interruption.
The statement is as follows:
Public boolean onKeyDown (int keyCode, KeyEvent event) {if (keyCode = KeyEvent. KEYCODE_BACK) {return true;} return false ;}
The onKeyDown method of the rewrite system. You can also disable other keys, either by using switch or if.