由网友(原来爱情会过期)分享简介:我只是想实现一个progressdialog,我有一些问题,在我漫长和复杂的计算来更改文本。I just tried to implement a progressdialog and I have some issues to change the text during my long and complex c...
我只是想实现一个progressdialog,我有一些问题,在我漫长和复杂的计算来更改文本。
I just tried to implement a progressdialog and I have some issues to change the text during my long and complex calculations.
for (String aString:myStringArray){
Log.v(TAG, aString);
mProgressDialog.incrementProgressBy(1);
mProgressDialog.setMessage(aString);
}
我可以清楚地看到incrementProgressBy工作和我的对话更新,但该消息并没有改变。
I can clearly see the incrementProgressBy working and my dialog updating, but the message does not change.
如何使这项工作任何想法?
Any idea on how to make that work?
感谢了很多。
推荐答案
刚刚找到了答案,这是工作的罚款:
Just found the answer, that's working fine:
runOnUiThread(changeMessage);
与code:
with that code:
private Runnable changeMessage = new Runnable() {
@Override
public void run() {
//Log.v(TAG, strCharacters);
m_ProgressDialog.setMessage(strCharacters);
}
};
相关推荐
最新文章