ProgressDialog doesn't appear

后端 未结 2 629
慢半拍i
慢半拍i 2021-01-13 09:31

I have the following in my Activity that I use to download a users films in their LoveFilm queue, but the ProgressDialog never appears.

public class MyListAc         


        
2条回答
  •  旧巷少年郎
    2021-01-13 10:05

    What if you call with this instead of MyListActivity.this?

    It is possible, though unlikely since this is within onCreate(), that it is not being called from the UI thread.

    Try surrounding the call with runOnUiThread():

        Activity me = this;
        runOnUiThread(new Runnable()
        {
            public void run()
            {
                m_progressDialog = ProgressDialog.show(me, "Please Wait", "Loading", true);
            }
        });
    

提交回复
热议问题