【发布时间】:2018-03-20 09:36:01
【问题描述】:
//**i have this in my onCreate**//
mInterstitial = new InterstitialAd(this);
mInterstitial.setAdUnitId(getResources().getString(<my another
ad_unit_id>));
mInterstitial.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
mInterstitial.loadAd(adRequest);
Log.d(TAG, "Interstitial Ad = onAdClosed()");
}
mInterstitial.loadAd(adRequest);
public void onBackPressed() {
super.onBackPressed();
displayInterstitial();
Log.d(TAG,"APP = onBackPressed()");
}
protected void displayInterstitial() {
Log.d(TAG, "start displayInterstitial()");
if (null!=mInterstitial&&mInterstitial.isLoaded()) {
Log.d(TAG, "displayInterstitial() loaded");
mInterstitial.show();
}
Log.d(TAG, "end displayInterstitial()");
}
当我放置测试添加(插页式)时,它出现在 backpress_ 之后,但另一个插页式广告无法加载。
【问题讨论】:
标签: android-studio interstitial