I am migrating from an old-style Menu button menu to the ActionBar in an
app that targets Android 3.0 and above. My ActionBar buttons are working
fine. But on devices that still have a hardware Menu button, the Menu
button causes the whole screen to be overlaid with a semi-transparent dark
screen, as if it were a very large empty menu. If any of my ActionBar
items are in the overflow menu (not displayed), then pressing the Menu
button brings up those overflowed items, which is fine. But if none of my
ActionBar items are in the overflow (they are all displayed in the
ActionBar), I want the Menu button to do nothing, but I can't get that to
happen. On devices without a Menu button, everything is fine because the
overflow icon is suppressed when there is nothing in the ActionBar overflow.
My ActionBar implementation is very standard:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.activity_main_actions, menu);
return super.onCreateOptionsMenu(menu);
}
where menu/activity_main_actions.xml lists two items with
showAsAction="ifRoom". If I change one of them to "never", the Menu button
shows me that item in a small menu, as it should. But if both things are
shown in the ActionBar, the Menu button shows the dark overlay that goes
away when you press the Back button. Is there any way I can prevent this
"empty menu" dark overlay?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.