Rajubhai Rathod
Rajubhai Rathod

Reputation: 511

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

Upvotes: 0

Views: 428

Answers (1)

Jordi Castilla
Jordi Castilla

Reputation: 26961

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.

Upvotes: 1

Related Questions