android如何在TabActivity中放置progressdialog [英] android how to put progressdialog in TabActivity

查看:43
本文介绍了android如何在TabActivity中放置progressdialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,其中有一个 TabActivity 并且有 2 个选项卡(每个选项卡作为一个活动)第一个选项卡(一个活动)从互联网加载数据.所以我想要一个进度对话框,直到第一个标签(一个活动)从互联网加载数据.

I hav an application where I have an TabActivity and which have 2tabs(each tab as an activity) First tab(an activity) loads data from internet. So I want there a progressdialog until the 1st tab(an activity) loads data from internet.

ProgressDialog.show(TabHostActivity.this, "Working..", "Downloading Data...",true);
pd.dismiss();

只有这么多代码我不满意请任何人告诉我我写了什么来显示进度对话框,直到它下载数据.(意味着我必须使用线程).请给我答案和代码谢谢

only this much code i have which not give satisfaction please anybody tell me what i write to show a progressdialog until it download the data. (means i hav to use thread). Please give me answer along with code Thank you

推荐答案

在 tabGroupActivity 中,使用progressDialog如下方式(如果你的activity是任何tabhost的子Activity):

In tabGroupActivity ,use progressDialog in the folllowing way( If your activity is the sub Activity of any tabhost):

ProgressDialog.show(getParent(), "Working..", "Downloading Data...",true);

试试这个,还有一件事是使用线程实现ProgressDialog:请参阅此帮助:如何在按钮上获取进度条点击?

try this, and one more thing implement ProgressDialog using threads: see this for help : How to get a progress bar on button click?

希望这能让你对这个话题有所了解.

Hope this will give you some idea on the topic.

这篇关于android如何在TabActivity中放置progressdialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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