Changing Progress Dialog Message While Running

↘锁芯ラ 提交于 2019-12-10 12:35:04

问题


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!


回答1:


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...



来源:https://stackoverflow.com/questions/5646448/changing-progress-dialog-message-while-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!