简体   繁体   中英

How to Hide Ad View in Recycler View

I have implemented Admob Native Express ads in my Recycler View. Its keeping blank space in list till advertise getting loaded as well if there no internet available. How can I hide that blank space till advertise get loaded ? Thanks

Just implement an AdListener that listen to the onAdLoaded event.

The onAdLoaded method is executed when an ad has finished loading. If you want to delay adding the AdView to your activity or fragment until you're sure an ad will be loaded, for example, you can do so here . If you're using a third-party analytics package to track impressions, this is also where you can place the call to record one.

Source

mAdView.setAdListener(new AdListener() {
    @Override
    public void onAdLoaded() {
        // HERE!!!!!!
    }
});

NOTE it's not necessary to override all methods

AdListener provides a default empty implementation for all of its ad lifecycle events. You only need to override the ad events you wish to implement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM