I have an action bar which contains a list navigation and a sub menu. I want to update the sub menu items according to the user selection in the list navigation. I'm trying to call invalidateOptionsMenu()
in the onNavigationItemSelected()
but this creates an infinite loop.
public boolean onNavigationItemSelected(int itemPosition, long itemId) {
invalidateOptionsMenu();
Log.i("onNavigationItemSelected", "onNavigationItemSelected called");
return true;
}
I'm using ActionBarSherlock
. This is one of my first Android/Java project.