Android Admob间隙误差

Android Admob间隙误差,android,admob,andengine,Android,Admob,Andengine,我想打电话给Admob中间人?在我的Android应用程序中多次使用。我把这件事搞糊涂了 interstitial = new InterstitialAd(this, "ID"); final AdRequest adRequest = new AdRequest(); interstitial.loadAd(adRequest); interstitial.setAdListener(this); 我试过这个代码,一次通话效果很好。当它第二次

我想打电话给Admob中间人?在我的Android应用程序中多次使用。我把这件事搞糊涂了

interstitial = new InterstitialAd(this, "ID");
        final AdRequest adRequest = new AdRequest();
        interstitial.loadAd(adRequest);
        interstitial.setAdListener(this);
我试过这个代码,一次通话效果很好。当它第二次调用时,向我显示错误

帮我解决这个问题


提前感谢。

您需要分离间隙的结构,加载广告并显示广告

public void onCreate(Bundle savedInstanceState) {
  interstitial = new InterstitialAd(this, "MY-AD-ID");
  interstitial.setAdListener(new AdListsner() {
     ..
  });
}

private void loadAd() {
  final AdRequest adRequest = new AdRequest();
  interstitial.loadAd(adRequest);
}

private void showAd() {
  if (interstitial.isLoaded()) {
    interstitial.show();
  }
}

也许可以添加错误的日志?