android 如何在 TabActivity 中放置进度对话框
我有一个应用程序,其中有一个 TabActivity 并且有 2 个选项卡(每个选项卡作为一个活动) 第一个选项卡(活动)从互联网加载数据。 所以我想要一个进度对话框,直到第一个选项卡(活动)从互联网加载数据。
ProgressDialog.show(TabHostActivity.this, "Working..", "Downloading Data...",true);
pd.dismiss();
我只有这么多代码但不能令人满意 请任何人告诉我我写了什么来显示进度对话框,直到它下载数据。 (意味着我必须使用线程)。 请给我答案和代码 谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 tabGroupActivity 中,按以下方式使用 ProgressDialog(如果您的 Activity 是任何 TabHost 的子 Activity):
尝试此操作,还有一件事使用线程实现 ProgressDialog:
请参阅此帮助:如何在按钮上获取进度条单击?
希望这会给您一些关于该主题的想法。
In tabGroupActivity ,use progressDialog in the folllowing way( If your activity is the sub Activity of any tabhost):
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.
您应该在第一个选项卡活动中实现 AsyncTask ,Asynctask 称为 < a href="http://developer.android.com/resources/articles/painless-threading.html" rel="nofollow">无痛线程。
只需完成上述两个链接,然后执行以下操作:
You should implement AsyncTask inside the First Tab activity, Asynctask is known as PainLess Threading.
Just go through the above 2 links and then do as follows: