Android Publisher Interstitial Ad displaying after close

91 views
Skip to first unread message

Nuno Silva

unread,
Jun 18, 2014, 7:46:56 AM6/18/14
to google-adm...@googlegroups.com

My application opens a Publisher InterstitialAd whenever you start but when a user closes it reopens. This process happens constantly and then you can't use application, can anyone help me?

public void getIntertitalAds(boolean isPortraitMode)
{
    interstitial = new PublisherInterstitialAd(context);
    if(isPortraitMode)
        interstitial.setAdUnitId(tags.getAdUnitInterstitial());
    else
        interstitial.setAdUnitId(tags.getAdUnitInterstitialTablet());

    AdListener adListener = new AdListener() {

        @Override
        public void onAdLoaded() {
            super.onAdLoaded();

            if(interstitial!=null)
                interstitial.show();
        }

        @Override
        public void onAdClosed() {
            super.onAdClosed();

            interstitial = null;
        }
    };

    // Create ad request.
    PublisherAdRequest adRequest = new PublisherAdRequest.Builder()
    .build();

    // Begin loading your interstitial.
    interstitial.setAdListener(adListener);
    interstitial.loadAd(adRequest);
}

Amy Quispe (AdMob SDK Team)

unread,
Jun 20, 2014, 2:42:02 PM6/20/14
to google-adm...@googlegroups.com
Hi Nuno,

You might want to look at this blog post written by my colleague Eric about creating a splash screen interstitial.

Amy Quispe
Reply all
Reply to author
Forward
0 new messages