安卓:显示在TabHost活动不确定的进度栏 [英] Android: Showing indeterminate progress bar in TabHost activity

查看:89
本文介绍了安卓:显示在TabHost活动不确定的进度栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道下面的code应该显示和隐藏在Android的下code一个很小的圆形进度条:

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);

问题是,我使用的是TabHost和我需要能够从儿童的活动之一做到这一点。有没有什么方法可以让我去这样做?

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?

我发现这个问题在intarwebs但正如你所看到的,它无人接听。

I found this question on the intarwebs but as you can see, it went unanswered.

推荐答案

和我找到了答案。在你父母的活动,你做的什么之前,你需要做的requestWindowFeature通话,然后在你的孩子的活动,你叫的getParent()setProgressBarIndeterminateVisibility(真/假)。

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);

这篇关于安卓:显示在TabHost活动不确定的进度栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆