如何在Android应用程序创建进度对话框? [英] How to create Progress Dialog in Android Application?

查看:385
本文介绍了如何在Android应用程序创建进度对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发的应用程序,同时接收我想显示进度对话框中的数据从互联网上接收的一些数据。我用的的AsyncTask我的应用程序。

I am developing the application to receive some data from the internet while receiving the data I want to show the "Progress Dialog". I used "AsyncTask" in my application.

问题是如何使用它,以及如何像显示100%的比例是多少?

请给我建议,给我一些例子。
谢谢你,对不起,我的英语水平。

Please suggest me and give me some example. Thank you and Sorry for my English.

推荐答案

要告诉你可以用下面的code中的prgress对话框

To show the prgress dialog you can use the below code

 ProgressDialog dialog = new ProgressDialog(MainActivity.this);
                dialog.setMessage("Your message..");
                dialog.show();

您之前调用异步任务,即在新YourTask.execute()

before you call the async task i.e. before new YourTask.execute().

和中的AsyncTask的onPostExecute功能,您可以使用

and in the onPostExecute function of the asynctask You can use

 dialog.dismiss();

要关闭该对话框。

这篇关于如何在Android应用程序创建进度对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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