I want to update a TextView from an asynchronous task in an Android application. What is the simplest way to do this with a Handler?
There
You can also update UI thread from background thread in this way also:
Handler handler = new Handler(); // write in onCreate function
//below piece of code is written in function of class that extends from AsyncTask
handler.post(new Runnable() {
@Override
public void run() {
textView.setText(stringBuilder);
}
});