0
I have a problem with delay in some interstitial ads adMob, which can cause undue clicks, until these days it was all right, but I don’t know why from one hour to the next started with this.
My code follows the Google standard, I suspect it is some advertisements that do not load on time causing this delay to show.
The code in Java is this:
private void requestNewInterstitial() {
AdRequest adRequest = new AdRequest.Builder().build();
interstitial.loadAd(adRequest);
}
In the onCreate
// Criar o anúncio intersticial.
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId(ADMOB_INTERSTICIAL); //meu codigo adMob
// importante colocar este codigo aqui
interstitial.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
requestNewInterstitial();
}
});
requestNewInterstitial();
The method:
// Chamar displayInterstitial() quando você estiver pronto para exibir um
// intersticial.
public void displayInterstitial() {
if (interstitial.isLoaded()) {
interstitial.show();
}
}
I ran several tests, and I realized the best way was to remove AndroidManifest.xml
this line here.
android:theme="@android:style/Theme.Translucent"
On the Google website asks to stay like this,
android:configChanges="keyboard|keyboardHidden|orientation|
screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
But it’s not rolling with this line Theme, I have some apps in landscape mode that looks cool with this line there, but apparently it won’t work.
Does anyone know what might be going on?