Get the options menu to display in the system panel

I am trying to open my options menu in the new Android 3.0 system bar. I can get this behavior to work with the Notepadv3 tutorial. However, when implementing almost the same functions, the menu is displayed in the above action bar, but not in the system bar. Any ideas?

The attached code for my application is:

public class AACUser extends Activity { private static final int ADMIN_ID = Menu.FIRST; public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, ADMIN_ID, 0, R.string.menu_admin); return true; } @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { switch(item.getItemId()) { case ADMIN_ID: enterAdminMode(); return true; default: return super.onMenuItemSelected(featureId, item); } } } 

I also tried to implement these menu functions according to the creation of the menu documentation :

 public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.user_menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemId()) { case R.id.menu_adminMode: enterAdminMode(); return true; default: return super.onOptionsItemSelected(item); } } 

but no difference: it still displays an option in the action bar overflow, but not in the system bar.

+2
java android menu
source share
2 answers

Starting with Android 3.0, the options menu is not required (if not outdated). If you are targeting API 11 (Android 3.0) or later, it is assumed that your application will run without an options menu, so the system panel will not display it. The options menu on the system panel is only available for backward compatibility with older applications. New applications should have different accessibility to access options, for example, provided by the action bar.

+2
source share

I think the menu button on the system bar is for backward compatibility only. Therefore, if you want to create your own application for Honeycomb, then the menu should be and will be in the action bar.

0
source share

All Articles