# CustomEvent

# CustomEvent


```
public interface CustomEvent
```

<br />

Known direct subclasses [CustomEventBanner](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEventBanner), [CustomEventInterstitial](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEventInterstitial), [CustomEventNative](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEventNative)

|---|---|
| `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEventBanner` | **This interface is deprecated.** Use `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/Adapter` instead. <br /> |
| `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEventInterstitial` | **This interface is deprecated.** Use `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/Adapter` instead. <br /> |
| `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEventNative` | **This interface is deprecated.** Use `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/Adapter` instead. <br /> |

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
>
> Use `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/Adapter` instead.

A `CustomEvent` is similar to a `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/MediationAdapter` except that it is a completely self-service mechanism for publishers to create their own adapter.

The most common use case for a `CustomEvent` is to add support for an ad network that doesn't already provide its own `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/MediationAdapter`.

There is no reason to implement this interface directly. Instead, custom events should implement `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEventBanner` and `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEventInterstitial`.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `[onDestroy](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEvent#onDestroy())()` Tears down the adapter control. |
| `abstract void` | `[onPause](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEvent#onPause())()` Called when the application calls `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/BaseAdView#pause()`. |
| `abstract void` | `[onResume](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEvent#onResume())()` Called when the application calls `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/BaseAdView#resume()`. |

## Public methods

### onDestroy

```
abstract void [onDestroy](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEvent#onDestroy())()
```

Tears down the adapter control.

This is called at the end of the custom event's life cycle. The adapter is expected to release any resources and shut down. After this method is called, any subsequent calls to any other method on this adapter may throw an `https://developer.android.com/reference/java/lang/IllegalStateException.html`.

This method is not guaranteed to be called. There are a number of reasons that this method can be skipped, such as a force close of the application.

### onPause

```
abstract void [onPause](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEvent#onPause())()
```

Called when the application calls `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/BaseAdView#pause()`. The custom event is expected to pause any processing associated with the ad being shown.

### onResume

```
abstract void [onResume](https://developers.google.com/admob/android/reference/com/google/android/gms/ads/mediation/customevent/CustomEvent#onResume())()
```

Called when the application calls `https://developers.google.com/admob/android/reference/com/google/android/gms/ads/BaseAdView#resume()`. The adapter is expected to resume any processing associated with the ad being shown.