我的应用程序在您启动时会打开一个 Publisher InterstitialAd,但当用户关闭时它会重新打开。这个过程不断发生,然后您无法使用应用程序,有人可以帮助我吗?
public void getIntertitalAds(boolean isPortraitMode)
{
interstitial = new PublisherInterstitialAd(context);
if(isPortraitMode)
interstitial.setAdUnitId(tags.getAdUnitInterstitial());
else
interstitial.setAdUnitId(tags.getAdUnitInterstitialTablet());
AdListener adListener = new AdListener() {
@Override
public void onAdLoaded() {
super.onAdLoaded();
if(interstitial!=null)
interstitial.show();
}
@Override
public void onAdClosed() {
super.onAdClosed();
interstitial = null;
}
};
// Create ad request.
PublisherAdRequest adRequest = new PublisherAdRequest.Builder()
.build();
// Begin loading your interstitial.
interstitial.setAdListener(adListener);
interstitial.loadAd(adRequest);
}