I think I did everything correctly, but the application jumps to the next activity without appearing anything.
public class...
private FirebaseAnalytics mFirebaseAnalytics;
private AdView adView01;
private AdRequest adRequest01;
private InterstitialAd adInter01;
onCreate()...
MobileAds.initialize(this, "ca-app-pub-6843243039127549/2394454715");
adView01=(AdView)findViewById(R.id.adView03);
adRequest01=new AdRequest.Builder().build();
adView01.loadAd(adRequest01);
adInter01=new InterstitialAd(this);
adInter01.setAdUnitId("ca-app-pub-6843243039127549/3871187910");
adInter01.loadAd(adRequest01);
mFirebaseAnalytics=FirebaseAnalytics.getInstance(this);
onClick()...
case R.id.btnCompras:
adInter01.show();
Intent it01 = new Intent(this, MainActivity02.class);
startActivity(it01);
break;
I think it may be a problem because I'm using the same AdRequest I use for the banner, but the banner keeps running. (this and other activity too)
Theapplicationdoesnotacknowledgeanyerrors,soitbecomesmoredifficulttodetectthecauseofnon-operation
SitewhereIgotinformationtoplaceaninterticialad=> link
EDIT 01 ----------------------------------
I've done what you indicated, see the code below:
case R.id.btnCompras:
adInter01.setAdListener(new AdListener(){
@Override
public void onAdClosed(){
Intent it01 = new Intent(this, MainActivity02.class);
startActivity(it01);
}
});
break;
But the attempt to implement the code, presented an error (could not transcribe, so the image):