6

出于某种原因,我在我的应用程序(冥想网络)中尝试使用 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 应该可以解决问题,但我仍然遇到错误。当我从包含广告的页面点击“返回”时,会出现错误。

4

0 回答 0