AdMob won't load programmatically
Posted
by
scottbot95
on Stack Overflow
See other posts from Stack Overflow
or by scottbot95
Published on 2012-11-16T16:50:44Z
Indexed on
2012/11/16
16:59 UTC
Read the original article
Hit count: 143
I'm need to include ads into my app and I have a settings option to disable ads. so I need to load the ad in code. I copied the code from google to handle that and when I set ads:loadAdOnCreate
to true
, it works just fine.
But if I set it to false and add the two lines
AdView adView = (AdView)this.findViewById(R.id.ad);
adView.loadAd(new AdRequest());
The ads stop displaying. If I look at log cat, it shows that it is receiving an ad and trying to display it. However it won't actually display on screen. Help?
© Stack Overflow or respective owner