MediationInterstitialListener | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
public interface

# MediationInterstitialListener

com.google.android.gms.ads.mediation.MediationInterstitialListener

## Class Overview

Callback for an adapter to communicate back to the mediation library. Events must be communicated back for the mediation library to properly manage ad flow.

## Summary

Public Methods
abstract void | onAdClicked(MediationInterstitialAdapter adapter) Indicates that the user has clicked on this ad.
abstract void | onAdClosed(MediationInterstitialAdapter adapter) Indicates that the ad control rendered something in full screen and is now transferring control back to the application.
abstract void | onAdFailedToLoad(MediationInterstitialAdapter adapter, int error) Indicates that an ad request has failed along with the underlying cause.
abstract void | onAdLeftApplication(MediationInterstitialAdapter adapter) Indicates that the ad is causing the device to switch to a different application (such as a web browser).
abstract void | onAdLoaded(MediationInterstitialAdapter adapter) Indicates that an ad has been requested and successfully received.
abstract void | onAdOpened(MediationInterstitialAdapter adapter) Indicates that the ad control is rendering something that is full screen.

## Public Methods

#### public abstract void onAdClicked (MediationInterstitialAdapter adapter)

Indicates that the user has clicked on this ad. This is used for publisher metrics, and must be called in addition to any other events; this event is never inferred by the mediation library. For example, `onAdLeftApplication(MediationInterstitialAdapter)` would generally mean that the user has clicked on an ad, but `onAdClicked(MediationInterstitialAdapter)` must be called regardless.

##### Parameters

adapter | The mediation adapter which raised the event.

#### public abstract void onAdClosed (MediationInterstitialAdapter adapter)

Indicates that the ad control rendered something in full screen and is now transferring control back to the application. This may be the user returning from a different application.

##### Parameters

adapter | The mediation adapter which raised the event.

##### See Also

- `onAdOpened(MediationInterstitialAdapter)`

#### public abstract void onAdFailedToLoad (MediationInterstitialAdapter adapter, int error)

Indicates that an ad request has failed along with the underlying cause. A failure may be an actual error or just a lack of fill.

Once an ad is requested, the adapter must report either success or failure. If no response is heard within a time limit, the mediation library may move on to another adapter, resulting in a potentially successful ad not being shown.

##### Parameters

adapter | The mediation adapter which raised the event.
error | An error code detailing the cause of the failure.

##### See Also

- `onAdLoaded(MediationInterstitialAdapter)`

#### public abstract void onAdLeftApplication (MediationInterstitialAdapter adapter)

Indicates that the ad is causing the device to switch to a different application (such as a web browser). This must be called before the current application is put in the background.

##### Parameters

adapter | The mediation adapter which raised the event.

#### public abstract void onAdLoaded (MediationInterstitialAdapter adapter)

Indicates that an ad has been requested and successfully received. Interstitials must wait for a `show()` call.

Once an ad is requested, the adapter must report either success or failure. If no response is heard within a time limit, the mediation library may move on to another adapter, resulting in a potentially successful ad not being shown.

From the point when this method is called until the adapter is destroyed, `showInterstitial()` should open the interstitial.

##### Parameters

adapter | The mediation adapter which raised the event.

##### See Also

- `onAdFailedToLoad(MediationInterstitialAdapter, int)`

#### public abstract void onAdOpened (MediationInterstitialAdapter adapter)

Indicates that the ad control is rendering something that is full screen. This may be an `Activity`, or it may be a precursor to switching to a different application.

Once this screen is dismissed, `onAdClosed(MediationInterstitialAdapter)` must be called.

##### Parameters

adapter | The mediation adapter which raised the event.