AdsLoader.EventListener


@UnstableApi
public interface AdsLoader.EventListener


Listener for ads loader events. All methods are called on the main thread.

Summary

Public methods

default void

Called when the user clicks through an ad (for example, following a 'learn more' link).

default void

Called when there was an error loading ads.

default void

Called when the ad playback state has been updated.

default void

Called when the user taps a non-clickthrough part of an ad.

Public methods

onAdClicked

default void onAdClicked()

Called when the user clicks through an ad (for example, following a 'learn more' link).

onAdLoadError

default void onAdLoadError(AdsMediaSource.AdLoadException error, DataSpec dataSpec)

Called when there was an error loading ads.

Parameters
AdsMediaSource.AdLoadException error

The error.

DataSpec dataSpec

The data spec associated with the load error.

onAdPlaybackState

default void onAdPlaybackState(AdPlaybackState adPlaybackState)

Called when the ad playback state has been updated. The number of ad groups may not change after the first call.

Parameters
AdPlaybackState adPlaybackState

The new ad playback state.

onAdTapped

default void onAdTapped()

Called when the user taps a non-clickthrough part of an ad.