1
I have an Interstitial admob on an Activity and when I press a button I put the following lines of code:
botaoid.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
} else {
startActivity(new Intent(mainTela.this,telaSecundaria.class));
}
}
});
The problem is that the Interstitial is opening when the screen is being closed, how to make first the Interstitial open and when closed start the screen?
On which screen is this code being placed?
– itscorey
@Luc in the mainTela
– Junior Klawa
Add the code from the second screen, and also from the first screen, if possible.
– itscorey
@Luc realized the mistake, hahaahahah, your question gave me a light, thanks man!
– Junior Klawa
You’re welcome, thank you! :)
– itscorey