au789
au789

Reputation: 5403

AdMob in ListView

Does anyone know how to add an AdView of admob in a list view?

Upvotes: 2

Views: 1836

Answers (3)

Gurinder Singh
Gurinder Singh

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

JRun
JRun

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

LeffelMania
LeffelMania

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

Related Questions