Class NativeAdLoader

com.yandex.mobile.ads.nativeads

public class NativeAdLoader

This class is a loader for native ads.

Nested Classes

Constructors

NativeAdLoader(final android.content.Context context, final String blockId)

Creates an object of the NativeAdLoader class.

NativeAdLoader(@NonNull final android.content.Context context, @NonNull final NativeAdLoaderConfiguration configuration)

Creates an object of the NativeAdLoader class with the configuration.

Methods

void cancelLoading()

Cancels loading a native ad.

void loadAd(final AdRequest request)

Loads native ads in the background.

void setNativeAdLoadListener(@Nullable final OnImageAdLoadListener listener)

Specifies an object of the OnImageAdLoadListener class for tracking the progress of native ad loading.

void setOnLoadListener(@Nullable final OnLoadListener listener)

Sets the object of the OnLoadListener class.

Constructor Detail

NativeAdLoader

public NativeAdLoader (final android.content.Context context, final String blockId)

Creates an object of the NativeAdLoader class.

Note.

This method is deprecated. Use the #NativeAdLoader(Context, NativeAdLoaderConfiguration) method.

Parameters:
context

An object of the Context system class.

blockId

Unique ID of the ad placement.

NativeAdLoader

public NativeAdLoader (@NonNull final android.content.Context context, @NonNull final NativeAdLoaderConfiguration configuration)

Creates an object of the NativeAdLoader class with the configuration.

Parameters:
context

An object of the Context system class.

configuration

Configuration for loading native ads.

Method Detail

cancelLoading

public void cancelLoading ()

Cancels loading a native ad.

loadAd

public void loadAd (final AdRequest request)

Loads native ads in the background.

Parameters:
request

An object of the AdRequest class with data for a targeted ad request.

setNativeAdLoadListener

public void setNativeAdLoadListener (@Nullable final OnImageAdLoadListener listener)

Specifies an object of the OnImageAdLoadListener class for tracking the progress of native ad loading.

Parameters:
listener

An object of the OnImageAdLoadListener class.

setOnLoadListener

public void setOnLoadListener (@Nullable final OnLoadListener listener)

Sets the object of the OnLoadListener class.

Note.

This method is deprecated. Use the #setNativeAdLoadListener(OnImageAdLoadListener) method.

Parameters:
listener

An object of the OnLoadListener class.