InterstitialAd
เวอร์ชั่นที่ใหม่กว่าของคลาสนี้พร้อมแล้ว ตรวจสอบได้ เวอร์ชั่นล่าสุด

InterstitialAd displays an advertisement by Facebook in an interstitial.

To use the interstitial, do the following:

InterstitialAd interstitial = new InterstitialAd(context, PLACEMENT_ID); interstitial.setAdListener(new AbstractAdListener() { public void onAdLoaded(Ad ad) { if (ad == interstitial) { interstitial.show(); } } }); interstitial.loadAd();

InterstitialAd requires InterstitialAdActivity to be declared in app's AndroidManifest.xml with android:configChanges="keyboardHidden|orientation".

ขยาย:Object
การนำไปใช้:Ad
แพ็คเกจ:ads
ผู้สร้าง
InterstitialAd(Context, String)

Constructs an InterstitialAd using the given context and placement id.

public InterstitialAd(Context context, String placementId)
พารามิเตอร์คำอธิบาย
contextAndroid context
placementIdId of ad placement
วิธีการแบบอินสแตนซ์
setAdListener(InterstitialAdListener)

Sets an InterstitialAdListener to be notified on events in control lifecycle.

public void setAdListener(InterstitialAdListener adListener)
พารามิเตอร์คำอธิบาย
adListenerThe listener
setImpressionListener(ImpressionListener)
public void setImpressionListener(ImpressionListener impListener)
พารามิเตอร์คำอธิบาย
impListenerThe listener
loadAd()

Loads an 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 void loadAd()
loadAd()
public void loadAd()
destroy()

Destroys the ad control.

This method should be called when the hosting activity of the ad control is destroyed.

public void destroy()
destroy()
public void destroy()
isAdLoaded()

Gets whether an ad is loaded and ready to show.

public boolean isAdLoaded()
Returns
Whether an ad is loaded
show()

Shows the interstitial ad.

This method should only be called after InterstitialAd.loadAd() is called and the listener is notified ad has been loaded.

public boolean show()
Returns
False if no ad is loaded, otherwise true