我正在尝试通过使用此tutorial ..将插页式广告集成到初始屏幕活动中,但是广告没有加载。
谁能告诉我问题出在哪里?
预先感谢
这是我的代码:
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId(getString(R.string.interstitial_full_screen));
mInterstitialAd.setAdListener(new AdListener()
{
@Override
public void onAdLoaded() {
if (!interstitialCanceled) {
waitTimer.cancel();
mInterstitialAd.show();
}
}
@Override
public void onAdFailedToLoad(int errorCode) {
startHomeMain();
}
});
waitTimer = new Timer();
waitTimer.schedule(new TimerTask() {
@Override
public void run() {
interstitialCanceled = true;
SplashScreenActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
startHomeMain();
}
});
}
}, 5000);
} // end of onCreate implementation.