has leaked window DecorView@dea56c0[SplashActivity] that was originally added here 的悬赏解决

博客探讨了一个在Android应用中遇到的窗体泄露问题,错误表现为DecorView泄露。尽管问题看似简单,但定位错误并不直接。内容提到了错误代码没有明确的报错行数,且Activity的主题设置被提及。开发者尝试了多种解决方案,包括使用软引用和静态Handle以及移除消息,但在压力测试下仍然出现问题。最终,在onDestroy()方法中添加了一行代码暂时解决了问题,但又带来了新的挑战。
摘要由CSDN通过智能技术生成

看了标题:这个不就是窗体泄露么,这么简单的问题,还悬赏, 先别急着下定论!

错误代码如下:

WindowManager: android.view.WindowLeaked: Activity com.wcyq.gangrong.ui.activity.SplashActivity has leaked window DecorView@dea56c0[SplashActivity] that was originally added here
                                                      at android.view.ViewRootImpl.<init>(ViewRootImpl.java:485)
                                                      at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346)
                                                      at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
                                                      at com.android.internal.policy.PhoneWindow.openPanel(PhoneWindow.java:886)
                                                      at com.android.internal.policy.PhoneWindow.onKeyUpPanel(PhoneWindow.java:1103)
                                                      at com.android.internal.policy.PhoneWindow.onKeyUp(PhoneWindow.java:2012)
                                                      at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:362)
                                                      at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4733)
                                                      at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4605)
                                                      at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
                                                      at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200)
                                                      at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166)
                                                      at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4293)
                                                      at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174)
                                                      at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4350)
             
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值