public final class InterstitialAd
extends com.yandex.mobile.ads.fullscreen.FullScreenAd
Constructor and Description |
---|
InterstitialAd(android.content.Context context)
Constructs a new
InterstitialAd programmatically. |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys this
InterstitialAd entirely and cleans up resources. |
boolean |
isLoaded()
Returns
true if this interstitial ad has been successfully loaded
and is ready to be shown, otherwise false . |
void |
loadAd(AdRequest adRequest)
Starts loading the ad by
AdRequest on a background thread. |
void |
setBlockId(java.lang.String blockId)
Sets a block id.
|
void |
setInterstitialAdEventListener(InterstitialAdEventListener interstitialAdEventListener)
Sets an
InterstitialAdEventListener . |
void |
show()
Shows the interstitial ad, only if it has been loaded.
|
public InterstitialAd(@NonNull android.content.Context context)
InterstitialAd
programmatically.context
- The activity context the view is running in, through which it can
access the current theme, resources, etc. In particular, it
uses the window manager and theme in this context to present its UI.public void setBlockId(@NonNull java.lang.String blockId)
blockId
- Unique ad placement ID created at partner interface. Example: R-M-DEMO-240x400-context.public void setInterstitialAdEventListener(@Nullable InterstitialAdEventListener interstitialAdEventListener)
InterstitialAdEventListener
.interstitialAdEventListener
- InterstitialAdEventListener
.public void loadAd(@NonNull AdRequest adRequest)
AdRequest
on a background thread.
NOTE:
The block id must be set before that.adRequest
- AdRequest
public void show()
public boolean isLoaded()
true
if this interstitial ad has been successfully loaded
and is ready to be shown, otherwise false
.true
if this interstitial ad has been successfully
loaded and is ready to be shown.public void destroy()
InterstitialAd
entirely and cleans up resources.
NOTE:
Don't work with this InterstitialAd
thereafter.