my question is this:
Can I disable menu button for a certain amount of time? I mean setting from ym app that for the next 10 minutes for example, if I press menu nothing will happen, even if I am in other app. After that time is pressed, menu functionalith will be retrieved.
My app will run in the backgrounf of course and will check the time, but I do not know if it is possible to “disable” that button. I am not asking on how to implement the time, but on how to disable the menu button.
How does it work?
The menu-event is handled inside the Android Framework. The framework consumes the KEYCODE_MENU. With other words, the event will not be dispatched and will never arrive in your application layer. This means, you can not override this functionality.
When you are building a new platform, you can alter the framework yourself. Inside the PhoneWindowManager (where the default
KeyEventsare being handled likeKEYCODE_HOME) you can add logic to handle theKEYCODE_MENUinside the methodinterceptKeyBeforeDispatching(..).