问题描述
开发一款WIFI管理APP,再wifi列表页面注册了广播监听,监听网络变化,页面是常驻内存的,跳转到其他app或者其他页面的时候,此页面存在被系统销毁的可能。
android.app.IntentReceiverLeaked: Activity com.xx.activity.FridgeMainActivity has leaked IntentReceiver com.xx.sifiview.WifiConnector$WifiConnectReceiver@46e4de0 that was originally registered here.? at android.app.LoadedApk$ReceiverDispatcher.(LoadedApk.java:1351) at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1132) at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1422) at android.app.ContextImpl.(ContextImpl.java:1395) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1383) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:609) at com.xx.sifiview.WifiConnector.registWifiConnectReceiver(WifiConnector.java:127) at com.xx.sifiview.WifiConnector.connect(WifiConnector.java:84) at com.xx.sifiview.SettingWifiView.connect(SettingWifiView.java:286) at com.xx.sifiview.SettingWifiView.onItemClick(SettingWifiView.java:260) at com.chad.library.adapter.base.BaseQuickAdapter.setOnItemClick(BaseQuickAdapter.java:987) at com.chad.library.adapter.base.BaseQuickAdapter$5.onClick(BaseQuickAdapter.java:966) at android.view.View.performClick(View.java:6300)
问题分析
页面回退之后,广播忘记反注册
问题解决
页面销毁调用反注册广播
还没有评论,来说两句吧...