I make action bar sherlock appliction and open for submenu on top bar actionbar shelock on click and shown but on device menu click not open for submenu inside for actionbar shelock kindly help me.
@Override
public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {
com.actionbarsherlock.view.SubMenu subMenu = menu.addSubMenu("Menu");
subMenu.add(0, SUB_MENU_1, 0,"Settings");
com.actionbarsherlock.view.MenuItem menuItem = subMenu.getItem();
menuItem.setIcon(R.drawable.menu_selector);
menuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
return true;
}
Here i m cofuse for open submenu for action bar sherlock on key down,
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (keyCode) {
case KeyEvent.KEYCODE_MENU:
// here some write code
return true;
}
}
return super.onKeyDown(keyCode, event);
}
Thanks in advance,