All Implemented Interfaces:
com.yandex.mobile.ads.fullscreen.FullScreenAdvertisable, com.yandex.mobile.ads.html.BaseAdvertisable


public final class RewardedAd
extends com.yandex.mobile.ads.fullscreen.FullScreenAd
Full-screen rewarded ad.

Field Summary

Fields inherited from class com.yandex.mobile.ads.fullscreen.FullScreenAd

FAILED_TO_SHOW_NOT_LOADED_AD

Constructor Summary

Constructors
Constructor and Description
RewardedAd(android.content.Context context)
Constructs a new RewardedAd programmatically.

Method Summary

All Methods
Instance Methods
Concrete Methods
Modifier and TypeMethod and Description
voiddestroy()
Destroys this RewardedAd entirely and cleans up resources.
booleanisLoaded()
Returns true if this rewarded ad has been successfully loaded and is ready to be shown, otherwise false.
voidloadAd(AdRequest adRequest)
Starts loading the ad by AdRequest on a background thread.
voidsetAdUnitId(java.lang.String adUnitId)
Sets an ad unit id.
voidsetRewardedAdEventListener(RewardedAdEventListener rewardedAdEventListener)
voidshow()
Shows the rewarded ad, only if it has been loaded.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

RewardedAd

public RewardedAd(@NonNull
                  android.content.Context context)
Constructs a new RewardedAd 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

loadAd

public void loadAd(@NonNull
                   AdRequest adRequest)
Starts loading the ad by AdRequest on a background thread. NOTE: The ad unit id must be set before that.
Parameters:
adRequest - AdRequest

isLoaded

public boolean isLoaded()
Returns true if this rewarded ad has been successfully loaded and is ready to be shown, otherwise false.
Returns:
true if this rewarded ad has been successfully loaded and is ready to be shown.

setAdUnitId

public void setAdUnitId(@NonNull
                        java.lang.String adUnitId)
Sets an ad unit id.
Parameters:
adUnitId - Unique ad placement ID created at partner interface.

setRewardedAdEventListener

public void setRewardedAdEventListener(@Nullable
                                       RewardedAdEventListener rewardedAdEventListener)
Parameters:
rewardedAdEventListener - RewardedAdEventListener.

show

public void show()
Shows the rewarded ad, only if it has been loaded.

destroy

public void destroy()
Destroys this RewardedAd entirely and cleans up resources. NOTE: Don't work with this RewardedAd thereafter.