mAdView = findViewById(R.id.ad_view);
RequestConfiguration conf = MobileAds.getRequestConfiguration().toBuilder()
.setTagForChildDirectedTreatment(TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE)
.setTagForUnderAgeOfConsent(TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE)
.setMaxAdContentRating(MAX_AD_CONTENT_RATING_G)
.build();
MobileAds.setRequestConfiguration(conf);
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("ca-app-pub-xxxxxxxxxxxx/xxxxxxxxx");
mInterstitialAd.setAdListener(new AdListener()
{
@Override
public void onAdLoaded()
{
//log interstitial loaded
}
@Override
public void onAdFailedToLoad(int errorCode)
{
Log.d(TAG, "onAdFailedToLoad : errorcode : " + String.valueOf(errorCode));
super.onAdFailedToLoad(errorCode);
}
@Override
public void onAdClosed()
{
AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);
// Ad interstitialAd reLoaded
Log.d(TAG, "Ad interstitialAd reLoaded");
super.onAdClosed();
}
});
mInterstitialAd.loadAd(new AdRequest.Builder().build());
@Override protected void onDestroy() {
super.onDestroy();
try {
if (mAdView != null) {
mAdView.setAdListener(null);
if (adscontainerWait != null)
adscontainerWait.removeAllViews();
mAdView.destroy();
}
mInterstitialAd = null;
} catch (Exception ex) {
Log.d(TAG, ex.toString());
}
}
Hi there,
Thank you for reporting this to us. For me to further check this on my end, could you provide the details below via Reply privately to author option?
Regards,
Mark Albios
Mobile Ads SDK Team
Hi there,
Thank you for providing additional details of the issue. I've downloaded your app in the Play Store; however, I wasn't able to replicate the issue on my end. Could you also share your App Id/ Ad Unit Id? In addition, could you confirm if the issue is reproducible locally? It would be much appreciated if you can provide a sample project (with the issue reproduced) to me so I could further investigate on my end.
Please use Reply privately to author option to send the details privately.
Regards,
Mark Albios
Mobile Ads SDK Team
Hi there,
Thank you for sharing additional information about the issue. As per further checking, I can see that there are other publisher that had previously reported this issue with a sample project. With that said, I'll raise this information to our Engineering team as well and get back to you as soon as they provide their feedback.
Regards,
Mark Albios
Mobile Ads SDK Team