java - Show action bar also for menu button? -


i'm creating action bar on ics. due spacing icons displayed. i'd supply action bar context-like menu with text if menu button of phone pressed.

how can achieve this?

atm have 3 icons. 2 of them displayed @ top in action bar. if press menu phone button, 3rd displayed contextmenu! i'd have 3 of them.

class myactivity extends sherlockfragmentactivity {     @override     public boolean oncreateoptionsmenu(menu menu) {         menuinflater inflater = getsupportmenuinflater();          /* implementation here */     } } 

from documentation on menus:

if menu item not appear action item, system places in overflow menu.

thus, showing same action item in both action bar and overflow menu not possible. could this:

  1. check (at runtime) menu items fit in action bar , not.

  2. for each menu item displayed in action bar, create new, identical menu item dynamically, making sure call newmenuitem.setshowasaction(show_as_action_never) ensure displayed in overflow menu (w/ text).

this, in opinion, goes against android's menu design standards , wouldn't suggest doing it. might appear better design choice in eyes, users expect apps consistent across entire android platform. manipulating menus in weird ways can cause confusion, , can negatively impact user experience result.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -