How can I change Action Bar actions dynamically?

前端 未结 4 773
南笙
南笙 2020-11-29 23:38

I have an Activity with ActionBar and tab navigation. I am using the split mode, so the tabs are at the top and actions are in the bottom bar. How can I dynamically change t

4条回答
  •  星月不相逢
    2020-11-30 00:09

    Activity.invalidateOptionsMenu() requires API Level 11. Use the Support library version of it supportInvalidateOptionsMenu().

    AppCompatActivity activity = (AppCompatActivity) getActivity();
    activity.supportInvalidateOptionsMenu();
    

提交回复
热议问题