I have onOptionsItemSelected(MenuItem item) in my fragment. Now I'm forced to use Android-ActionItemBadge library(https://github.com/mikepenz/Android-ActionItemBadge), to add the ActionBar Notification Count. so I added the piece of code in my Fragment.
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
//Inflating the Menu
inflater.inflate(R.menu.refresh_menu, menu);
//inflating Notification Icon
if (badgeCount > 0) {
ActionItemBadge.update(getActivity(), menu.findItem(R.id.badge),
FontAwesome.Icon.faw_android, ActionItemBadge.BadgeStyle.DARKGREY, badgeCount);
} else {
ActionItemBadge.hide(menu.findItem(R.id.badge));
}
}
But this Optionsitemselected return the value to my Activity but not in to my Fragment. any Idea? I want to Handle this Optionsitemselected in my Fragment.