Package com.yandex.mobile.ads.nativeads
Class NativeAdLoader
- java.lang.Object
-
- com.yandex.mobile.ads.nativeads.NativeAdLoader
-
@MainThread public class NativeAdLoader extends java.lang.Object
Class containing controls for native ad loading.
-
-
Constructor Summary
Constructors Constructor Description NativeAdLoader(android.content.Context context)
Constructs a newNativeAdLoader
with specific configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelLoading()
Cancel loading the native ad.void
loadAd(NativeAdRequestConfiguration nativeAdRequestConfiguration)
Start loading the native ad byNativeAdRequestConfiguration
on a background thread.void
setNativeAdLoadListener(NativeAdLoadListener listener)
Register a callback for listening native ad loader.
-
-
-
Constructor Detail
-
NativeAdLoader
public NativeAdLoader(@NonNull android.content.Context context)
Constructs a newNativeAdLoader
with specific configuration.- Parameters:
context
- The activity context used to retrieve the application context.
-
-
Method Detail
-
setNativeAdLoadListener
public void setNativeAdLoadListener(@Nullable NativeAdLoadListener listener)
Register a callback for listening native ad loader.- Parameters:
listener
- anNativeAdLoadListener
object that handles lifecycle native ad.
-
loadAd
public void loadAd(@NonNull NativeAdRequestConfiguration nativeAdRequestConfiguration)
Start loading the native ad byNativeAdRequestConfiguration
on a background thread.- Parameters:
nativeAdRequestConfiguration
- anNativeAdRequestConfiguration
object contains targeting information used to fetch a native ad.
-
cancelLoading
public void cancelLoading()
Cancel loading the native ad.
-
-