当我从旧的Google AdMob SDK升级到新的Google Pay Services SDK时,我注意到插页式广告关闭的速度与下一个活动的启动速度不同(这也会带来新的布局)。在过去,它几乎是即时的。现在,有了新的Play服务插页式广告,我注意到点击" x"在新活动开始之前的插页式广告。
如何摆脱这种延迟?
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId(AD_UNIT_ID);
AdRequest adRequest = new AdRequest.Builder().build();
final Intent nextActive = new Intent("activity");
interstitial.loadAd(adRequest);
interstitial.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
super.onAdClosed();
//Intent nextActive = new Intent("activity");
startActivity(nextActive);
}
@Override
public void onAdFailedToLoad(int errorCode) {
super.onAdFailedToLoad(errorCode);
//Intent nextActive = new Intent("activity");
startActivity(nextActive);
}
@Override
public void onAdLeftApplication() {
super.onAdLeftApplication();
}
@Override
public void onAdOpened() {
super.onAdOpened();
}
@Override
public void onAdLoaded() {
displayInterstitial();
super.onAdLoaded();
}
});