How can I re-upload after I close the Admob 2021 interstitial?

I'm switching to the new Admob 2021 interstitials. New InterstitialAd My main event has 10 episodes and no matter which one I switch to, an interstitial ad will appear. However, when I got back to the event, I noticed that it wasn't showing again. What I want to do is reload after closing the interstitial ad.

public class MainActivity extends Activity {

private InterstitialAd mInterstitialAd;

protected void onCreate(Bundle savedInstanceState) {

  MobileAds.initialize(this, new OnInitializationCompleteListener() {
    public void onInitializationComplete(InitializationStatus initializationStatus) {}
  AdRequest adRequest = new AdRequest.Builder().build();

  InterstitialAd.load(this,"ca-app-pub-3940256099942544/1033173712", adRequest, new InterstitialAdLoadCallback() {
  public void onAdLoaded(@NonNull InterstitialAd interstitialAd) {
    // The mInterstitialAd reference will be null until
    // an ad is loaded.
    mInterstitialAd = interstitialAd;
    Log.i(TAG, "onAdLoaded");

  public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
    // Handle the error
    Log.i(TAG, loadAdError.getMessage());
    mInterstitialAd = null;

} }

Read more here:

Content Attribution

This content was originally published by serif at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: