NOTE: The functionality below is now deprecated in the Support Library.
You need to call
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS)
in your onCreate()
before setting the activity’s layout:
e.g.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
... // set layout etc
If you are using the support library replace requestWindowFeature with supportRequestWindowFeature
And then call
setProgressBarIndeterminateVisibility(true);
on your Activity whenever you want to show the progress spinner.