i've been Places, while searching for this.. I got a Menu (main.xml) with exactly 3 Buttons (Settings, Refresh, Add).
<item
android:id="@+id/menu_refresh"
android:icon="@drawable/ic_action_refresh"
android:title="@string/menu_refresh"
support:showAsAction="ifRoom"/>
<item
android:id="@+id/menu_add"
android:icon="@drawable/ic_action_add"
android:title="@string/menu_add"
support:showAsAction="ifRoom"/>
<item
android:id="@+id/menu_settings"
android:icon="@drawable/ic_action_settings"
android:title="@string/menu_settings"
support:showAsAction="never"/>
Now what i want is have a simple boolean Variable. If the var is true the Refresh item should be replaced with a refresh gif or progress bar. I know how to hide / unhide items and i've tryed both: placing a gif there instead and placing a progressbar element there, but nothing seems to work. The gif wasn't animating and the progressbar was invisible. I have assigned the Menu to a var: myMenu = menu;, in Order to access it.
Can anybody push me in the right direction? I can google myself, if i know what to search for, but i don't mind if it's just a pseudo sample or a link.