ProgressDialog created from onCreateDialog stops animating on second run

后端 未结 4 1487
情歌与酒
情歌与酒 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:23

    Ha! Got it... was also struggling with this. But calling:

    removeDialog(DIALOG_PROGRESS_ID)
    

    immediately after

    dismissDialog(...)
    

    removes it from the (presumed) dialog cache for the Activity and forces a call to onCreateDialog. Create a new ProgressDialog in onCreateDialog and the spinner animates everytime (for me at least).

提交回复
热议问题