问题描述
我有一个非常简单的问题,我不知道如何解决。我想在它的运行并显示更改进度对话框的消息文本。这方面的一个例子是像一个剩余时间计数器,而进度动画旋转,将倒计时。我不知道我会如何处理这因为这样做progressDialog.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!
推荐答案
您可能要检查this问题出的
在短期:你需要创建一个Runnable的一点,你可以使用 runOnUiThread
...
In short: You need to create a little Runnable which you can execute on the UI thread using runOnUiThread
...
这篇关于更改进度对话框信息,而运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!