I want to load AdMob interstitial ads when the users opens the app and resumes the app after minimizing the app.
I am using the following code to load AdMob interstitial ads onResume
:
@Override
protected void onResume() {
super.onResume();
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId(getString(R.string.interstitial_ad));
AdRequest request = new AdRequest.Builder()
.tagForChildDirectedTreatment(true)
.build();
mInterstitialAd.loadAd(request);
mInterstitialAd.setAdListener(new AdListener() {
public void onAdLoaded() {
showInterstitial();
}
});
}
But the ads keep loading repeatedly after closing. I tried to limit ads display once in 5 minutes in AdMob settings but it didn't work. How do I prevent ads from loading repeatedly?