开发者

Refreshing the Action Bar in Android 3.0

I am trying to implement an action bar within an activity. Is it possible to "refresh" or re-inflate the action bar with a new me开发者_如何学Gonu(without restarting the activity) The only way I have found so far is to leave the action bar empty and assign it a new customView every time I want it changed.


Try calling invalidateOptionsMenu() on your activity. Quoting the documentation:

Declare that the options menu has changed, so should be recreated. The onCreateOptionsMenu(Menu) method will be called the next time it needs to be displayed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜