I'd like the navigation drawer opened when the options menu button is pressed. So in my Sherlock Fragment activity I added:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (!mDrawerLayout.isDrawerOpen(mDrawerLinear)) {
mDrawerLayout.openDrawer(mDrawerLinear);
}
return true;
}
For some reason nothing happens when the options menu button is pressed.
Otherwise the drawer is working fine. It opens when the app icon on the action bar is pressed or when I pull it. So what's wrong?
Maybe your referring to onKeyDown (int keyCode, KeyEvent event)
sample:
@Override
public boolean onKeyDown(int keyCode, KeyEvent e) {
if (keyCode == KeyEvent.KEYCODE_MENU) {
// your action...
if (!mDrawerLayout.isDrawerOpen(mDrawerLinear)) {
mDrawerLayout.openDrawer(mDrawerLinear);
}
return true;
}
return super.onKeyDown(keyCode, e);
}