fbsamples / audience-network

Open source projects to demonstrate SDK and sample code usages and integration, and to collaborate and support peers in this community.
https://developers.facebook.com/docs/audience-network
Other
319 stars 370 forks source link

Native ads in recyclerview returning 0 adItems.size() [Android] #128

Closed BlackFish768 closed 3 years ago

BlackFish768 commented 3 years ago

mAdItems (arrayList of ads) says content of mAditems are queried but never updated thus it is returing 0 item size in getItemCount due to which some items of other arraylist are missing. If i have 20 items and 1 ad per 5 items = 4 ads in total then last 4 item won't show

BlackFish768 commented 3 years ago

I fixed it. It was my mistake. I wasn't adding NativeAd to the arrayList.

if (ad != null) { mAdItems.add(ad) }