android - Creating Separate OnClick Listeners for Left and Right Navigation Drawers -
i have 2 navigation drawers/menus:
however need little bit of setting onclick listener right action bar menu.
currently - have onclick listener left action bar menu
@override public boolean onoptionsitemselected(menuitem item) { if (mdrawertoggle.onoptionsitemselected(item)) { return true; } return super.onoptionsitemselected(item); }
however i'm not sure how might able handle onclick event right action bar menu.
any suggestions appreciated.
full xml , java source:
try this:
@override public boolean onoptionsitemselected(menuitem item) { if (mdrawertoggle.onoptionsitemselected(item)) { return true; } else { switch (item.getitemid()) { case r.id.action_more: // change action_more own id in main.xml menu // stuff here (your right click method) return true; // rest of menu actions here... } } return super.onoptionsitemselected(item); }
Comments
Post a Comment