When and how often is the onPrepareOptionsMenu() method called for ActionBar?
Use invalidateOptionsMenu() to trigger onPrepareOptionMenu() method as suggested by document.
On Android 3.0 and higher, you must call invalidateOptionsMenu() when you want to update the menu, because the menu is always open. The system will then call onPrepareOptionsMenu() so you can update the menu items.