public class NativeAdLoader
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
NativeAdLoader.OnImageAdLoadListener
Interface that is implemented to determine when the loading of native advertising has completed or failed.
|
static interface |
NativeAdLoader.OnLoadListener
Interface that is implemented to determine when the loading of native advertising has completed or failed.
|
Constructor and Description |
---|
NativeAdLoader(android.content.Context context,
NativeAdLoaderConfiguration configuration)
Constructs a new
NativeAdLoader with specific configuration. |
NativeAdLoader(android.content.Context context,
java.lang.String blockId)
Deprecated.
Use
NativeAdLoader(Context, NativeAdLoaderConfiguration) instead. |
Modifier and Type | Method and Description |
---|---|
void |
cancelLoading()
Cancel loading the native ad.
|
void |
loadAd(AdRequest request)
Start loading the native ad by
AdRequest on a background thread. |
void |
setNativeAdLoadListener(NativeAdLoader.OnImageAdLoadListener listener)
Register a callback for listening native ad loader.
|
void |
setOnLoadListener(NativeAdLoader.OnLoadListener listener)
Deprecated.
Use {
setNativeAdLoadListener(OnImageAdLoadListener) } instead. |
public NativeAdLoader(android.content.Context context, java.lang.String blockId)
NativeAdLoader(Context, NativeAdLoaderConfiguration)
instead.NativeAdLoader
for specific block ID.context
- The activity context used to retrieve the application context.blockId
- Unique ad placement ID created at partner interface.
Identifies ad placement for specific application.
Example: R-M-XXXXXX-Y.public NativeAdLoader(@NonNull android.content.Context context, @NonNull NativeAdLoaderConfiguration configuration)
NativeAdLoader
with specific configuration.context
- The activity context used to retrieve the application context.configuration
- Loader configuration.public void setOnLoadListener(@Nullable NativeAdLoader.OnLoadListener listener)
setNativeAdLoadListener(OnImageAdLoadListener)
} instead.listener
- an NativeAdLoader.OnLoadListener
object that handles lifecycle native ad.public void setNativeAdLoadListener(@Nullable NativeAdLoader.OnImageAdLoadListener listener)
listener
- an NativeAdLoader.OnImageAdLoadListener
object that handles lifecycle native ad.public void loadAd(AdRequest request)
AdRequest
on a background thread.request
- an AdRequest
object
contains targeting information used to fetch a native ad.public void cancelLoading()