[英]Changing Progress Dialog Message While Running
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.
我不确定如何处理这个问题,因为即使在正在运行的线程中,执行progressDialog.setMessage(String)也不会改变Dialog本身的任何内容。 Thank you!
谢谢!
You might want to check this question out. 您可能想要查看此问题 。
In short: You need to create a little Runnable which you can execute on the UI thread using runOnUiThread
... 简而言之:您需要创建一个可以使用
runOnUiThread
在UI线程上执行的Runnable ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.