protected synchronized void setupAd(final NativeExpressAdView adView) {
        if(mFetchFailCount > MAX_FETCH_ATTEMPT)
            return;

        if(!mPrefetchedAds.contains(adView))
            mPrefetchedAds.add(adView);
        adView.setAdListener(new AdListener() {
            @Override
            public void onAdFailedToLoad(int errorCode) {
                super.onAdFailedToLoad(errorCode);
                // Handle the failure by logging, altering the UI, etc.
                onFailedToLoad(adView, errorCode);
            }
            @Override
            public void onAdLoaded() {
                super.onAdLoaded();
                onFetched(adView);
            }
        });
    }
protected synchronized void setupAd(final NativeExpressAdView adView) {
        if(mFetchFailCount > MAX_FETCH_ATTEMPT)
            return;

        if(!mPrefetchedAds.contains(adView))
            mPrefetchedAds.add(adView);
        adView.setAdListener(new AdListener() {
            @Override
            public void onAdFailedToLoad(int errorCode) {
                super.onAdFailedToLoad(errorCode);
                
                onFailedToLoad(adView, errorCode);
            }
            @Override
            public void onAdLoaded() {
                super.onAdLoaded();
                onFetched(adView);
            }
        });
    }
protected synchronized void setupAd ( final NativeExpressAdView adView ) { if ( mFetchFailCount > MAX_FETCH_ATTEMPT ) return ; if ( ! mPrefetchedAds . contains ( adView ) ) mPrefetchedAds . add ( adView ) ; adView . setAdListener ( new AdListener ( ) { @ Override public void onAdFailedToLoad ( int errorCode ) { super . onAdFailedToLoad ( errorCode ) ; // Handle the failure by logging, altering the UI, etc. onFailedToLoad ( adView , errorCode ) ; } @ Override public void onAdLoaded ( ) { super . onAdLoaded ( ) ; onFetched ( adView ) ; } } ) ; }
Subscribing to the native ads events
@param adView
Subscribing to the native ads events