public class RewardedVideoAd extends java.lang.Object implements Ad
RewardedVideoAd rewardedVideo = new RewardedVideoAd(context, PLACEMENT_ID);
rewardedVideo.setAdListener(new AbstractAdListener() {
public void onAdLoaded(Ad ad) {
}
});
rewardedVideo.loadAd();
Constructor and Description |
---|
RewardedVideoAd(android.content.Context context,
java.lang.String placementID)
Constructs a RewardedVideoAd given the context and the placement id
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys the ad control.
|
java.lang.String |
getPlacementId()
Get the placementId for this ad.
|
boolean |
isAdLoaded()
Tells whether an ad is loaded and ready to show
|
void |
loadAd()
Loads an ad.
|
void |
setAdListener(RewardedVideoAdListener adListener)
Sets an RewardedVideoAdListener to be notified on events in control lifecycle.
|
void |
setRewardData(RewardData rewardData) |
boolean |
show()
Shows the rewarded video ad
This method should only be called after
loadAd()
is called and the ad listener has been notified ad has loaded |
public RewardedVideoAd(android.content.Context context, java.lang.String placementID)
context
- Android contextplacementID
- id of ad placementpublic void loadAd()
Ad
This method always returns immediately. The ad is loaded asynchronously. The control's ad listener will be called when loading finishes or fails.
public boolean show()
loadAd()
is called and the ad listener has been notified ad has loadedpublic void setAdListener(RewardedVideoAdListener adListener)
adListener
- public void destroy()
Ad
This method should be called when the hosting activity of the ad control is destroyed.
public boolean isAdLoaded()
public java.lang.String getPlacementId()
Ad
getPlacementId
in interface Ad
public void setRewardData(RewardData rewardData)