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, in onCreate()
, before you call setContentView()
. Then you can use setProgressBarIndeterminateVisibility(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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With