If I request a progress dialog like this in my main Activity then it is displayed as expected:
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
But if I set the visibility to “false”, and then reset it to “true” inside the called procedure in which I want to deploy it, nothing is displayed. Moving the requestWindowFeature to the procedure causes an exception. How should I be doing this?
You need to call
requestWindowFeature()only once, inonCreate(), before you callsetContentView(). Then you can usesetProgressBarIndeterminateVisibility(true|false)to show or hide the progress indicator from anywhere in the activity (as long as it is on the UI thread, of course).