progress dialog is not displaying in async task when asynctask is called from separate class

前端 未结 5 661
小蘑菇
小蘑菇 2021-01-23 06:54

I have posted a question Progress Dialog is not displaying while getting data from separate thread class but I haven\'t got the appropriate answers. I have already used async t

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 07:38

    You can do UI operations only from an UI thread. Try running it on an UI thread.

    runOnUiThread(new Runnable() {
    
            public void run() {
                mProgressDialog.show();
            }
        });
    

提交回复
热议问题