Reputation: 5403
Does anyone know how to add an AdView of admob in a list view?
Upvotes: 2
Views: 1836
Reputation: 857
I've been using admob with a listview as well.
That's the code I am using:
http://www.ahotbrew.com/how-to-put-admob-banner-on-the-bottom/
Upvotes: 0
Reputation: 3428
http://googleadsdeveloper.blogspot.co.il/2012/03/embedding-admob-ads-within-listview-on.html
Even though I think something's off with the height calculation
Upvotes: 0
Reputation: 12875
My suggestion would be to write your own list adapter (extend BaseAdapter<?>
), and return an AdView from the adapter's getView() method. getView() gives you the position of the View that is being created, so you can just check the position and return an AdView wherever you want, and inflate the normal View for the other positions.
Upvotes: 2