How to show progress indicator or progress indicator in bar header in android?

I have an HTTP request and some user interface changes during this time, and I want to show an activity indicator for this time. I want to show it in the title. I want to show the progress indicator in the title in android, as an activity indicator in iphone?

+3
source share
2 answers

From the code of your activity:

getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
...
// when you need to show progress:
setProgressBarIndeterminate([true|false]);
+7
source

Yes, above two / three lines should be used as follows.

1) You must add this method before to call the setContentView () method.

getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

2) You must add this after calling the setContentView () method.

setProgressBarIndeterminateVisibility(true);

To stop the progress bar

setProgressBarIndeterminateVisibility(false);

,

ParentActivity parent = (ParentActivity)getParent();
parent.setProgressBarIndeterminateVisibility(false);
+4

All Articles