Activity has leaked window that was originally added

后端 未结 30 3253
野趣味
野趣味 2020-11-21 05:48

What is this error, and why does it happen?

05-17 18:24:57.069: ERROR/WindowManager(18850): Activity com.mypkg.myP has leaked window com.android.internal.pol         


        
30条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-21 06:31

    Try below code , it will work any time you will dismiss the progress dialogue and it will see whether its instance is available or not.

    try {
            if (null != progressDialog && progressDialog.isShowing()) {
                progressDialog.dismiss();
                progressDialog = null;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    

提交回复
热议问题