【问题标题】:Why my interstitial ads always load/show on app为什么我的插页式广告总是在应用中加载/显示
【发布时间】:2014-02-28 02:54:29
【问题描述】:

我成功实施了插页式广告 admob,但我有 1 个问题,为什么插页式广告总是每秒显示在我的应用上,所以我无法播放我的应用,因为这个插页式广告

任何想帮助我如何让插页式广告在每次应用启动时只显示 1 个插页式广告

这里是我的应用活动代码:

public class Activity extends Activity implements AdListener {
    WebView mWebView;
    private InterstitialAd interstitial;

    .......

    interstitial = new InterstitialAd(this, "a15xxxxxxxxxx");
    AdRequest adRequest = new AdRequest();
    interstitial.loadAd(adRequest);
    interstitial.setAdListener(this);

    .......

    public void onReceiveAd(Ad ad) {
          Log.d("OK", "Received ad");
          if(interstitial.isReady()) {
             interstitial.show();
          }
    }

【问题讨论】:

    标签: android admob ads interstitial


    【解决方案1】:

    Migrate from AdMob to google-play-services, AdMob is deprecated

    如果.isLoaded(),您应该展示您的广告

    if (interstitial.isLoaded()) {
      interstitial.show();
    } else {
      Log.d(LOG_TAG, "Interstitial ad was not ready to be shown.");
    }
    

    Here is an example for Interstitial ads

    【讨论】:

    • 感谢您的回复,但我没有成功将带有 AdMob 的插页式广告添加到 google-play-services。我用日食
    【解决方案2】:

    您的问题很可能是因为您在收到广告后立即展示广告(即 onAdReceived)。对于插页式广告,您应该改为在应用的自然断点处展示广告。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-06
      相关资源
      最近更新 更多