public void loadInterstitialAndShowWhenLoaded() {
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId(getString(R.string.admob_interstitial_id));
AdRequest adRequest = new AdRequest.Builder().build();
interstitial.loadAd(adRequest);
interstitial.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
super.onAdClosed();
nextActivity();
}
@Override
public void onAdFailedToLoad(int errorCode) {
super.onAdFailedToLoad(errorCode);
nextActivity();
}
@Override
public void onAdLoaded() {
super.onAdLoaded();
interstitial.show();
}
});
}
private void nextActivity() {
startActivity(...);
finish();
}public void onAdLoaded() {
super.onAdLoaded();
interstitial.show();
}Hi Mehran,
This thread had its last response back in January 2018, so it is unlikely that the original poster will respond to your post. Kindly create a new thread instead for your concerns so that we can assist you better on it.
Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team