ProgressDialog created from onCreateDialog stops animating on second run

后端 未结 4 1474
情歌与酒
情歌与酒 2021-01-02 22:40

I create a ProgressDialog in onCreateDialog() like so:

protected Dialog onCreateDialog(int id) {
  if (id == DIALOG_PROGRESS_ID)
           


        
4条回答
  •  自闭症患者
    2021-01-02 23:26

    Well, a not-so-cool workaround would to edit the parameters and not declaring the int private as in the examples. Of course, you lose the ability to switch on onCreateDialog, but you don't seem to be doing that anyway:

    showDialog(++DIALOG_PROGRESS_ID);
    

    Of course if the dialog is shown numerous times, you could have memory errors. Not pretty, but should work.

提交回复
热议问题