ProgressDialog不想要更新的消息 [英] ProgressDialog does not want to update the message

查看:162
本文介绍了ProgressDialog不想要更新的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想实现一个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);
    }
};

这篇关于ProgressDialog不想要更新的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆