public interface Ad
Modifier and Type | Method and Description |
---|---|
int |
getTimeout()
Gets the current timeout value in milliseconds.
|
boolean |
isLoading()
Gets whether this Ad is currently being loaded.
|
boolean |
loadAd()
Creates a background thread to load a new ad.
|
boolean |
loadAd(AdTargetingOptions adTargetingOptions)
Creates a background thread to load a new ad based on AdTargetingOptions.
|
void |
setListener(AdListener adListener)
Sets the listener used to track ad life-cycle events.
|
void |
setTimeout(int timeout)
Sets the timeout value for loading the ad.
|
void setListener(AdListener adListener)
adListener
- An instance of AdListener that will be notified during ad life-cycle changes.boolean loadAd(AdTargetingOptions adTargetingOptions)
AdListener.onAdLoaded(Ad, AdProperties)
is called.
When the ad fails to load the
AdListener.onAdFailedToLoad(Ad, AdError)
is called.
An ad that is currently loaded will only be cleared if the new loadAd(AdTargetingOptions)
call completes successfully.
loadAd(AdTargetingOptions)
call will return true if a background thread is created to load a new ad, and false if the
load ad request is ignored because there is currently a background thread in progress.
adTargetingOptions
- Additional ad options. Use this parameter to set targeting settingsboolean loadAd()
boolean isLoading()
loadAd(AdTargetingOptions)
call can be made.int getTimeout()
void setTimeout(int timeout)
loadAd(AdTargetingOptions)
is called.
The default value is 20000 milliseconds.timeout
- The timeout in milliseconds.