I'm using the ActionBar. I'd like to have a refresh progress spinner on the titlebar, if I set it to spinning - otherwise hide it. Is that possible?:
// My menu has a refresh item, but it shouldn't be visible on the
// actionbar unless it's spinning.
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_refresh"
android:title="@string/refresh"
android:icon="@drawable/ic_action_refresh" />
</menu>
...
// When I need to show some work being done on my activity,
// can I somehow now make the spinner associated with the
// refresh item become visible on the action bar?
getActionBarHelper().setRefreshActionItemState(true);
I don't want it on the ActionBar unless it's "in progress" / spinning.
Thanks
Apologies for no code tags, posting from phone...
This is from ActionbarSherlock (Google that if you've not come across it, allows actionbar support in pre honeycomb)
In onCreate of main activity
To show/hide progress in action bar. Notice with actionbarsherlock you must use boolean.TRUE/FALSE, not just true/false.........
If you extends from a ActionBarActivity, try this: