Activity has leaked window at alertDialog show() method

前端 未结 6 968
旧时难觅i
旧时难觅i 2020-12-14 16:23

I am getting window leak error at runtime because of using an AlertDialog.

I have pointed out the error line in the code below:

Stacktrace:<

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 16:33

    Dismiss the alertDialog in onPause() method. i.e. call alertDialog.dismiss()

    Note : WindowLeaked exceptions are occured usually if dialogs are not dismissed before Activity is ended.

提交回复
热议问题