Search code examples
androidpythonsl4a

How to detect if menu button was pressed using sl4a?


Is there a way to detect if the 'menu/settings' button has been pressed on an Android phone using sl4a?

I was looking through the API reference, and it looks like the 'Events' section is what I need, but it doesn't specify anything about either the menu, home, search, or back buttons.


Solution

  • You need to use the UIFacade to add items to menus, which will allow you to set up the events. You use the Events Facade to handle them.