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) {
but no difference: it still displays an option in the action bar overflow, but not in the system bar.
java android menu
Ian
source share