Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProgressDialog does not want to update the message

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);
}

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?

Thank a lot.

like image 388
Waza_Be Avatar asked Oct 16 '10 00:10

Waza_Be


1 Answers

Just found the answer, that's working fine:

runOnUiThread(changeMessage);

with that code:

private Runnable changeMessage = new Runnable() {
    @Override
    public void run() {
        //Log.v(TAG, strCharacters);
        m_ProgressDialog.setMessage(strCharacters);
    }
};
like image 57
Waza_Be Avatar answered Sep 20 '22 13:09

Waza_Be