运行时更改进度对话框消息
我有一个相当简单的问题,我不知道如何解决。我想在进度对话框运行和显示时更改其消息文本。一个例子是“剩余时间”计数器,它会在进度动画旋转时进行倒计时。我不确定如何解决这个问题,因为即使在正在运行的线程中执行progressDialog.setMessage(String),也不会改变对话框本身的任何内容。谢谢你!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要检查此问题。
简而言之:您需要创建一个小的 Runnable,您可以使用
runOnUiThread
在 UI 线程上执行它...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
...