0

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.

  • 1
    http://www.michenux.net/android-refresh-item-action-bar-circular-progressbar-578.html http://stackoverflow.com/questions/9731602/animated-icon-for-actionitem http://androidblog.reindustries.com/animating-update-or-loading-refresh-actionbar-button/ to name three useful links – Frame91 Oct 19 '15 at 07:12
  • Wow i guess im simply to stupid to search properly.. will try it after work, thanks! – Martin McCormack Oct 19 '15 at 07:14

0 Answers0