更改进度对话框信息,而运行 [英] Changing Progress Dialog Message While Running

查看:113
本文介绍了更改进度对话框信息,而运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的问题,我不知道如何解决。我想在它的运行并显示更改进度对话框的消息文本。这方面的一个例子是像一个剩余时间计数器,而进度动画旋转,将倒计时。我不知道我会如何处理这因为这样做pro​​gressDialog.setMessage(字符串),即使正在运行的线程内,不会改变在对话框本身什么。谢谢!

I've got a fairly simple issue I'm not sure how to resolve. I want to change the message text of a Progress Dialog while it's running and showing. An example of this would be something like a "time remaining" counter that would count down while the progress animation is spinning. I'm not sure how I would approach this because doing progressDialog.setMessage(String), even within a running thread, will not change anything in the Dialog itself. Thank you!

推荐答案

您可能要检查<一个href=\"http://stackoverflow.com/questions/3947080/progressdialog-does-not-want-to-update-the-message\">this问题出的

在短期:你需要创建一个Runnable的一点,你可以使用 runOnUiThread ...

In short: You need to create a little Runnable which you can execute on the UI thread using runOnUiThread...

这篇关于更改进度对话框信息,而运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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