I know that the following code should show and hide a tiny circular progress bar with the following code in Android:
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
setProgressBarIndeterminateVisibility(false);
The problem is that I am using a TabHost and I need to be able to do this from one of the "child" activities. Is there any way I can go about doing this?
I found this question on the intarwebs but as you can see, it went unanswered.
And I found the answer. In your parent activity, before you do anything, you need to do the requestWindowFeature call, and then in your child activity you call getParent().setProgressBarIndeterminateVisibility(true/false);
If the task is running in a different thread other than Main ui thread, you can do:
this.runOnUiThread(new Runnable() {
public void run() {
getParent().setProgressBarIndeterminateVisibility(mToggleIndeterminate);
}
});
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