I have a menu defined in an XML file such a "home_menu.xml" like this:
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <!-- Should always be in the overflow --> <item android:id="@+id/action_settings" android:showAsAction="never" android:title="@string/action_settings"/> <item android:id="@+id/action_user_preferences" android:showAsAction="never" android:title="@string/action_user_preferences"/> <item android:id="@+id/action_logout" android:showAsAction="never" android:title="@string/action_logout"/> </menu>
In my "Home" activity, I can access this menu by pushing the menu button in a device that has a physical button, but I don't want to use action bar so I want to add a Navigation Drawer for this purpose as Google Maps does.
It would be great if I could use the same onOptionsItemSelected() method defined in my Home activity to handle menu actions.