Android IllegalArgumentException for dismissDialog

前端 未结 3 1586
别那么骄傲
别那么骄傲 2021-02-15 14:18

I have used following code for download some files from our internet.

public class SplashDownload extends Activity {

    public static final int PROGRESS_DIALOG         


        
相关标签:
3条回答
  • 2021-02-15 14:25

    Does your progress dialog actually show up?
    Instead of dismissing it you could try using removeDialog(PROGRESS_DIALOG); to have it cleaned up.

    0 讨论(0)
  • 2021-02-15 14:27

    When you do the

    mProgressDialog.show();
    

    during

    protected Dialog onCreateDialog(int id)
    

    you already set the ID for the Dialog to some random or null value. So when you call to dismiss it, the Application thinks you are crazy.

    0 讨论(0)
  • 2021-02-15 14:45

    See if this thread helps - AlerDialog is not created - java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id X

    0 讨论(0)
提交回复
热议问题