How to stop a DoubleClick interstitial

31 views
Skip to first unread message

Saïmiris

unread,
Dec 12, 2013, 2:31:15 PM12/12/13
to google-adm...@googlegroups.com

I need to display a DoubleClick interstitial on Activity A and a simple DoubleClick banner on Activity B, and I need to display the interstitial during only 3 seconds and then go to Activity B (in case the use doesn't click on the interstitial close button).

Both interstitial and banner are currently displaying fine expect when I'm waiting these 3 seconds : in that case, the simple banner on Activity B doesn't show anymore on Activity B and I get this log :

loadAd called while an interstitial or landing page is displayed, so aborting

It seems that the only way to properly "undisplay" an interstitial is passing through the onDismissScreen function, but I can't do that neither.

My code is this one

@Override
public void onPresentScreen(Ad ad)
{
    if (ad == interstitial_ad)
    {
        // 3-second timer
        Handler handler = new Handler();
        handler.postDelayed(new Runnable()
        {
            public void run()
            {
                 startActivity(new Intent("Activity B"));
            }
        }, 3000);
    }
}

I already tried all these possibilities

if (interstitial_ad != null)
{
    interstitial_ad.stopLoading();
    interstitial_ad.loadAd(null);
    interstitial_ad.setAdListener(null);
    interstitial_ad = null;
}

and nothing works.

Any clue?

Thanks in advance.

William Ferguson

unread,
Dec 15, 2013, 6:11:42 AM12/15/13
to google-adm...@googlegroups.com
Once you have displayed an interstitial it is out of your hands.
It is entirely up to the user to choose when to dismiss it.

You need to adjust your business logic to work with that.

William
Reply all
Reply to author
Forward
0 new messages