AsyncTask OnPostExecute not updating TextView

后端 未结 2 610
死守一世寂寞
死守一世寂寞 2020-12-19 19:57

I have an AsyncTask running. I have a TextView that I mimic the message a Toast initially produces. I want to clear the TextView

2条回答
  •  -上瘾入骨i
    2020-12-19 20:10

    Try something like:

    ((TextView) findViewById(R.id.textView2)).setText("");
    

    EDIT:

    try making a variable outside the onCreate like TextView text; and then inside the onCreate put: text = (TextView) findViewById(R.id.textView2);

    and then just put text.setText(""); inside the onPostExecute method.

    See if that works.

提交回复
热议问题