Progress dialog problem in Android

后端 未结 3 535
醉酒成梦
醉酒成梦 2021-01-13 02:37

I want to create a simple ProgressDialog in my Activity. I created it like this:

protected void onCreate(Bundle savedInstanceState) {
    super.         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-13 03:32

    If you create a new Thread and set it to sleep for some time, only the new Thread sleeps. That has no effect on the UI-Thread where you'r Activity is created! Also, this isn't a good way of doing this anyways.

    Also, you can't show the Dialog before your Activity became visible. Try it in the onStart-method.

提交回复
热议问题