1

So I've got a weird situation.

I have an app that has a banner, an interstital, and a rewards video ad all on the same view.

Before you freak, the banner ad shows all the time and I want to switch between the other 2 types instead of always showing just reward videos etc.

So banner shows and the other 2 show on a button press.

The ads work great by themselves. I can get all ads working. But the issue comes up when I want to show the interstital ad instead of the rewards video.

I have logic that simply checks which to show and shows 1. The video ads work and always have. The baner also works fine. The interstital doesn't work at all unless I immediately show it unpon loaded.

For example. If my code says this :

private void buildInterstial()
    {
        mInterstitialAd = new InterstitialAd(this);
        mInterstitialAd.setAdUnitId(getString(R.string.button_add_unit_id));
        mInterstitialAd.setAdListener(new AdListener() {
            @Override
            public void onAdLoaded()
            {
                EnableDisableButton("enable");
                mInterstitialAd.show();
            }

            @Override
            public void onAdClosed() {
                AdClosed();
                EnableDisableButton("disable");
            }
        });
    }

It works. It shows right after it loads. If however I move the show to that button click like this:

if(showReward && mAd.isLoaded()) {
            mAd.show();
        }
        else if(showReward && mInterstitialAd.isLoaded() )
        {
            mInterstitialAd.show();
        }

}

It doesn't work. Instead the reward video works and the interstital always says its not loaded but that doesn't make sense since it was fired from the ads on load method.

Again. If I have either the video ads OR the interstital everything works. But if I want to switch between the 2 only the rewards videos work as the interstital always says false when checked if loaded.

The Android monitor windows says :

W/MessageQueue: Handler (android.os.Handler) {15b0fa22} sending message to a 
Handler on a dead thread
The webview is destroyed. Ignoring action.
Cannot call determinedVisibility() - never saw a connection for the pid
W/ExoPlayerImplInternal: Sent message(1) after release. Message ignored.

I've check all over google but no one seems to have the same issue.

I've checked : Admob interstitial ad not working in this situation

android interstitial ad is not diplaying

Android Interstitial Ad does not show

https://github.com/delight-im/Android-AdvancedWebView/issues/35

Android Webview: Cannot call determinedVisibility() - never saw a connection for the pid

and more.

Can anyone help with this? For now I just show the vids but I'd like to be able to choose.

I don't know if it hates my banner or if something hates me setting the buttons visibility when the ad is closed or what.

Thanks.

Community
  • 1
  • 1
Jeremy Styers
  • 497
  • 5
  • 23

0 Answers0