Indeterminate progress spinner is visible by default @ non-native action bar

Author: TobiaqsCreated May 7, 2014Updated May 7, 2014

After requesting the FEATURE_INDETERMINATE_PROGRESS feature in onCreate, older devices instantly show the spinner, whilst native action bar devices don't.

_Reproduction_

public class Main extends SherlockActivity {
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.test);
  }
}

_Workaround_

public class Main extends SherlockActivity {
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setSupportProgressBarIndeterminateVisibility(false); // or true if you want the spinner to be visible by default
    setContentView(R.layout.test);
  }
}

Source: JakeWharton/ActionBarSherlock