I'm using ActionBarSherlock-4.1.0-0 and I would like to open my submenu in the Actionbar with the hardware menu button. I'm planing an update and in my old version I used the "normal" menu. I'd like to help users to get used to the new design.
I got the submenu and the main-menu:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater i = getSupportMenuInflater();
i.inflate(R.menu.main_menu, menu);
SubMenu subMenu = (SubMenu) menu.findItem(R.id.actionbar_submenu);
Menu mainMenu = menu;
return super.onCreateOptionsMenu(menu);
}
and I got a listener to the hardware menu button:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(event.getAction() == KeyEvent.ACTION_DOWN){
switch(keyCode) {
case KeyEvent.KEYCODE_MENU:
// TODO: expand submenu from actionbar
return true;
}
}
return super.onKeyDown(keyCode, event);
}
I couldn't find a method or anything else to call.