AdView appears but disappears after a second

165 views
Skip to first unread message

Michael Thielen

unread,
Dec 15, 2013, 5:58:49 PM12/15/13
to google-adm...@googlegroups.com
Hi all, I'm trying to integrate ads into my game but I'm now running into an issue where the ad will either not show up at all (but the area where the ad would be is clickable) or the ad banner will appear for a second and then disappear (but the area will remain clickable again). The ads seem to be really inconsistent. I'm not sure how this could be possible since I'm using a test device. Has anyone encountered this before? What would make an AdView invisible but clickable? Is it perhaps a test ad issue? Here is an example of the code I use to display the ad on the main menu:

    public void showAdMainMenu() {
       
        adRequest = new AdRequest.Builder().addTestDevice(HTC_phone).build();
       
        game.getActivity().runOnUiThread(new Runnable() {
            @Override
            public void run() {
                //hide all other ads first
                adView_paused.setEnabled(false);
                adView_paused.setVisibility(View.INVISIBLE);
                adView_gameover.setEnabled(false);
                adView_gameover.setVisibility(View.INVISIBLE);
               
                adView_mainmenu.setEnabled(true);
                adView_mainmenu.loadAd(adRequest);
                adView_mainmenu.setVisibility(View.VISIBLE);
            }
        });
    }

I basically will have 3 ads within 1 activity for my game. So anytime I show one I turn the others off first.

William Ferguson

unread,
Dec 17, 2013, 5:37:02 AM12/17/13
to google-adm...@googlegroups.com
You're not pausing the ads on the AdViews. And with 3 AdViews running it wouldn't surprise me if they confusing each other wrt state. After all Admob policy is only a single AdView. Perhaps that is partly due to technical issues with multiple AdViews making requests in the background at the same time.

You can verify this is the issue by commenting out 2 of the AdViews.

If that's it then, you could try pausing the AdViews. 
Or rethink your use case.

William
Reply all
Reply to author
Forward
0 new messages