Activity has leaked window that was originally added

后端 未结 30 3734
野趣味
野趣味 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:28

    In my case, the reason was that I forgot to include a permission in the Android manifest file.

    How did I find out? Well, just like @Bobby says in a comment beneath the accepted answer, just scroll further up to your logs and you'll see the first reason or event that really threw the Exception. Apparently, the message "Activity has leaked window that was originally added" is only an Exception that resulted from whatever the first Exception is.

提交回复
热议问题