chuck
chuck

Reputation: 141

Admob ad in Listview

Can someone point me in the right direction, I am trying to use Ad mob ad in the list view. I want them to come up as every 10th item. I tried some examples but they are not working with new Google play services version of Ad Mob.

Thanks in Advance.

Upvotes: 0

Views: 647

Answers (2)

Alessandro Roaro
Alessandro Roaro

Reputation: 4733

This can be done using an adapter to "decorate" your content adapter. Take a look at this article.

Basically you have a function isAdPosition(int position) which tells your adapter to create an ad if it's the 10th, 20th, ... position, or to delegate the creation of the view to your content adapter if it's not an ad position.

Upvotes: 0

William
William

Reputation: 20196

Can I suggest that you will struggle to get this to work for a number of reasons. You are much better off setting up an AdView either above or below your ListView.

Upvotes: 1

Related Questions