AdMob View always visible regardless of view state (Android)

147 views
Skip to first unread message

Nuno Silva

unread,
May 16, 2013, 9:03:07 AM5/16/13
to google-adm...@googlegroups.com
I'm working on Android and have noticed that whenever I get an Ad from AdMob the admob view will automagically not only become visible but also add itself to my content view. This is a problem since there are times when I don't want the admob view to appear right now but it still shows up regardless of it being invisible.

For instance, setting a breakpoint just before I change its visiblity in the onAdReceived callback, I get the view visiblity state, and it is still invisible, but it still shows up on top of my view hierarchy long before the callback is even called.

So to sum it up, setting the admob view to invisible makes it appear regardless, and it keeps adding itself to my view hierarchy somehow. Does anyone have any idea what might be the problem?

Eric Leichtenschlag

unread,
May 17, 2013, 9:31:44 PM5/17/13
to google-adm...@googlegroups.com
Hi Nuno,

Can you provide a small sample app that demonstrates the issue? The AdView shouldn't behave any differently than any other view, in that it should respect the visibility settings you give it.

Thanks,
Eric

Nuno Silva

unread,
May 18, 2013, 5:33:11 AM5/18/13
to google-adm...@googlegroups.com
I tried creating a sample app but I was unable to reproduce the problem. My View Hierarchy is simply a RelativeLayout containing a GLSurfaceView, and I set up a breakpoint on every time I would add or remove the view, but the view appears long before any of these are called.

Any advice would be helpful.

Thank you for your time,
Nuno Silva.

Nuno Silva

unread,
May 19, 2013, 5:46:19 AM5/19/13
to google-adm...@googlegroups.com
I was able to reproduce the bug. It seems to happen only if the InMobi SDK is running alongside the Admob SDK.

here's a link to a working example (you need to set up your keys tho): http://www.mediafire.com/?f2id42w14ss8i7i

I don't know why but as long as the InMobi SDK runs alongside AdMob it'll automagically add the AdMob view to the layout, probably in place of the InMobi SDK's view. Maybe they have the same view ID or something?

Eric Leichtenschlag

unread,
May 20, 2013, 10:34:33 AM5/20/13
to google-adm...@googlegroups.com
Hi Nuno,

This sample is trying to run its own mediation layer, by simultaneously requesting ads from two networks and trying to figure out which one to show. Instead of writing this code yourself, the AdMob SDK supports mediation right out of the box. All you have to do is go to mediation.admob.com and create a mediation placement with AdMob and InMobi and configure their request priorities, and include the AdMob SDK, InMobi SDK, and InMobi adapter into your project. Then, just use the mediation placement ID instead of your AdMob publisher ID when making ad requests to AdMob, and we'll handle all the network transitions for you.

Cheers,
Eric
Reply all
Reply to author
Forward
0 new messages