出于某种原因,我在我的应用程序(冥想网络)中尝试使用AdMob时仍然遇到此错误。
Activity com.tfl.tfl.tagDetailActivity has leaked IntentReceiver com.adsdk.sdk.banner.AdView$6@405940a0 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Activity com.tfl.tfl.tagDetailActivity has leaked IntentReceiver com.adsdk.sdk.banner.AdView$6@405940a0 that was originally registered here. Are you missing a call to unregisterReceiver()?
以下是相关的代码: 的OnCreate
adView = new AdView(this, AdSize.BANNER, ADMOB_PUBLISHER_ID);
LinearLayout layout = (LinearLayout) findViewById(R.id.tag_detail_ad_layout);
layout.addView(adView);
adView.loadAd(buildAdMobRequest());
...
@Override
public void onDestroy() {
if (adView != null) {
adView.destroy();
}
super.onDestroy();
}
通过阅读它似乎破坏adview应该解决问题,但我仍然得到错误。当我从包含广告的页面点击“返回”时会出现错误。