My activity class extends android.support.v7.app.ActionBarActivity. I am requesting window feature and calling setSupportProgressBarIndeterminateVisibility() in the onCreate() method as follows:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_main);
setSupportProgressBarIndeterminateVisibility(true);
}
I cannot grasp what's wrong with my code and why I am getting java.lang.NullPointerException
raised by the setSupportProgressBarIndeterminateVisibility()
.
My gradle dependencies contains:
compile 'com.android.support:appcompat-v7:21.0.0'
Does anybody know how to use the indeterminate progress bar in the support.v7 action bar with the API 21?