android - Two different MenuItems with different time response -
i have 2 different menu items (flipping , sharing) share single activity. each 1 of them, works , smooth own, when put them together, flipping action takes long respond. can do? help.
flipping action:
@override public boolean oncreateoptionsmenu(menu menu) { super.oncreateoptionsmenu(menu); // add either "photo" or "finish" button action bar, depending on page // selected. menuitem item = menu.add(menu.none, r.id.action_flip, menu.none, mshowingback ? r.string.action_photo : r.string.action_info); item.seticon(mshowingback ? r.drawable.ic_action_photo : r.drawable.ic_action_info); item.setshowasaction(menuitem.show_as_action_if_room); return true; }
share action
public boolean onprepareoptionsmenu(menu menu) { getmenuinflater().inflate(r.menu.share_menu, menu); menuitem item = menu.finditem(r.id.menu_item_share); mshareactionprovider = (shareactionprovider) item.getactionprovider(); mshareactionprovider.setshareintent(getdefaultshareintent()); return super.onprepareoptionsmenu(menu); }
i left question open, , forgot it. however, took again , remember how solve it. doing wrong. had call super.onprepareoptionsmenu(menu) before this:
@override public boolean onprepareoptionsmenu(menu menu) { super.onprepareoptionsmenu(menu); getmenuinflater().inflate(r.menu.share_menu, menu); menuitem item = menu.finditem(r.id.menu_item_share); mshareactionprovider = (shareactionprovider) item.getactionprovider(); mshareactionprovider.setshareintent(getdefaultshareintent()); return true; }
Comments
Post a Comment