Reputation: 33
I ran this(Google Codelab Native Ads) code and the native ads in the list are sometimes working fine but most of the time they are like the bottom two screenshots. They are not in order and repeating themselves.
Can anyone please check whats wrong in this demo code? Tried on different devices but no luck :(
Screenshot1.
Screenshot2
Upvotes: 3
Views: 1202
Reputation: 58
Only two things in your RecyclerView adapter
@Override
public long getItemId(int position) {
return position;
}
and in constructor of adapter
setHasStableIds(true);
I tried this on same demo and git it working correctly.
Upvotes: 1