Показать спиннер прогресса (обновления) на ActionBar?

Я использую ActionBar. Я хотел бы иметь спиннер прогресса обновления на панели заголовков, если я установлю его на вращение - в противном случае скрыть его. Возможно ли это?:

// 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);

Я не хочу, чтобы он был на ActionBar, если он не "в процессе" / вращается.

Спасибо

31
задан louielouie 21 March 2012 в 22:28
поделиться