IllegalArgumentException? Why?

前端 未结 2 460
感情败类
感情败类 2021-02-14 18:20

Can anyone explain to me why this error occures, or even better how do I handle it? I can not reproduce it. It is one of those errors that happends once out of a 1000.

B

2条回答
  •  忘了有多久
    2021-02-14 18:27

    This can happen if the user either dismisses the view (e.g. a dialog that can be backed out of) or if the user switches to a different activity while your task is running. You should seriously think about using Android's activity-native dialog showing/dismissing instead of trying to keep a reference to the views yourself. But if you are handling it yourself, you may want to check if the dialog is actually showing using the dialog's isShowing() method before trying to dismiss it.

提交回复
热议问题