I want to integrate the Native Advance Ad into my RecyclerView. My app shows ad in every 6 items when you scroll down the display. To avoid a lot of ad downloading, I tried to load UnifiedNativeAd 5 times when the RecyclerView shows up, and push these ads into an ArrayList.
As the user scrolls down the display, then onBindViewHolder is called, my app gets an ad from the ArrayList and displays 1st ad, 2nd ad..., and after 5th ad, it returns to show the 1st ad.
I already wrote most of the code using RecyclerView.Adapter and it works fine if you don't mind the content of the ad.
The problem is that, when you return to show 1st ad, only the media content of the ad is different from that of displayed before. Other information, like headline, body, advertiser, is correct. I am not sure why this happens. The summary of the situation is as follows;
My expectation:
MediaContent Other(HeadLine, etc) 1st ad Ad - A Ad - A 2nd ad Ad - B Ad - B 3rd ad Ad - C Ad - C 4th ad Ad - D Ad - D 5th ad Ad - E Ad - E 6th ad Ad - A Ad - A 7th ad Ad - B Ad - B 8th ad Ad - C Ad - C 9th ad Ad - D Ad - D 10th ad Ad - E Ad - E
Problem:
1st ad Ad - A Ad - A 2nd ad Ad - B Ad - B 3rd ad Ad - C Ad - C 4th ad Ad - D Ad - D 5th ad Ad - E Ad - E 6th ad Ad - E Ad - A←From this row, MediaContent is random 7th ad Ad - A Ad - B 8th ad Ad - A Ad - C 9th ad Ad - B Ad - D 10th ad Ad - C Ad - E
Do we have a display ad immediately after loading ads? Is it not appropriate to buffer UnifiedNativeAd in ArrayList? Does anyone have a better idea to show UnifiedNativeAd in the RecyclerView with saving CPU resource and network traffic?