Reputation: 897
I create a menu.xml , only one action item with the "always" inside it. now I want to use the this method to change the menu's visible ,remove old action item , add new action item , change the old action item's icon ... so how to implement this ? I don't want the onCreateOptionMenu to be called more than once as the activity has presented by Android system.
Upvotes: 0
Views: 1064
Reputation: 804
onPrepareOptionsMenu()
will be called automatically after onCreateOptionsMenu()
.
And if you called invalidateOptionsMenu()
on any action-item click event, then, it will be called again.
Upvotes: 1