Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

Ads repeating on running the demo code. #11

Open

Description

@yashasvij28

I ran this code and the native ads in the list are sometimes working fine but most of the time they are like the bottom two screenshots.
Can you please check whats wrong in this demo code?
Tried on different devices but no luck :(

I just changed the layout of the ad for the demonstration of the issue, so I could show that multiple ads are showing on same page together.

image
image

Activity

  1. ingvictoriano commented on Jan 16, 2019

    @ingvictoriano

    I'm having the same issue. I've tracked it down to adLoader.isLoading()

    According to documentation

    public boolean isLoading ()
    Returns true if the ad is loading. If multiple ads are requested, returns true until all ads finish loading.

    But it appears that it sometimes returns true even if the 5 native ads aren't loaded. So on onUnifiedNativeAdLoaded the method insertAdsInMenuItems() is called multiple times.

    Workaround is to change the if to

    if (mNativeAds.size() == NUMBER_OF_ADS) {
         insertAdsInMenuItems();
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions