Class InterstitialAd
- java.lang.Object
-
- com.yandex.mobile.ads.fullscreen.FullScreenAd
-
- com.yandex.mobile.ads.interstitial.InterstitialAd
-
- All Implemented Interfaces:
com.yandex.mobile.ads.fullscreen.FullScreenAdvertisable
,com.yandex.mobile.ads.html.BaseAdvertisable
public final class InterstitialAd extends com.yandex.mobile.ads.fullscreen.FullScreenAd
Full-screen interstitial ads.
-
-
Constructor Summary
Constructors Constructor Description InterstitialAd(android.content.Context context)
Constructs a newInterstitialAd
programmatically.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Destroys thisInterstitialAd
entirely and cleans up resources.boolean
isLoaded()
Returnstrue
if this interstitial ad has been successfully loaded and is ready to be shown, otherwisefalse
.void
loadAd(AdRequest adRequest)
Starts loading the ad byAdRequest
on a background thread.void
setAdUnitId(java.lang.String adUnitId)
Sets an ad unit id.void
setInterstitialAdEventListener(InterstitialAdEventListener interstitialAdEventListener)
Sets anInterstitialAdEventListener
.void
show()
Shows the interstitial ad, only if it has been loaded.
-
-
-
Constructor Detail
-
InterstitialAd
public InterstitialAd(@NonNull android.content.Context context)
Constructs a newInterstitialAd
programmatically.- Parameters:
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.
-
-
Method Detail
-
setAdUnitId
public void setAdUnitId(@NonNull java.lang.String adUnitId)
Sets an ad unit id.- Parameters:
adUnitId
- Unique ad placement ID created at partner interface. Example: R-M-DEMO-240x400-context.
-
setInterstitialAdEventListener
public void setInterstitialAdEventListener(@Nullable InterstitialAdEventListener interstitialAdEventListener)
Sets anInterstitialAdEventListener
.- Parameters:
interstitialAdEventListener
-InterstitialAdEventListener
.
-
loadAd
public void loadAd(@NonNull AdRequest adRequest)
Starts loading the ad byAdRequest
on a background thread.NOTE:
The ad unit id must be set before that.- Parameters:
adRequest
-AdRequest
-
show
public void show()
Shows the interstitial ad, only if it has been loaded.
-
isLoaded
public boolean isLoaded()
Returnstrue
if this interstitial ad has been successfully loaded and is ready to be shown, otherwisefalse
.- Returns:
true
if this interstitial ad has been successfully loaded and is ready to be shown.
-
destroy
public void destroy()
Destroys thisInterstitialAd
entirely and cleans up resources.NOTE:
Don't work with thisInterstitialAd
thereafter.
-
-