# VirtualDisplay.Callback

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Callback

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/hardware/display/VirtualDisplay.Callback "View this page in Java")  

```
abstract class Callback
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                       ||
| ↳ | [android.hardware.display.VirtualDisplay.Callback](https://developer.android.com/reference/kotlin/android/hardware/display/VirtualDisplay.Callback#) |

Interface for receiving information about a[VirtualDisplay](https://developer.android.com/reference/kotlin/android/hardware/display/VirtualDisplay)'s state changes.

## Summary

|                                                         Public constructors                                                          ||
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| [Callback](https://developer.android.com/reference/kotlin/android/hardware/display/VirtualDisplay.Callback#Callback())`()` <br /> |

|                                                                                                                                                                                  Public methods                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onPaused](https://developer.android.com/reference/kotlin/android/hardware/display/VirtualDisplay.Callback#onPaused())`()` Called when the virtual display video projection has been paused by the system or when the surface has been detached by the application by calling setSurface(null). |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onResumed](https://developer.android.com/reference/kotlin/android/hardware/display/VirtualDisplay.Callback#onResumed())`()` Called when the virtual display video projection has been resumed after having been paused.                                                                        |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStopped](https://developer.android.com/reference/kotlin/android/hardware/display/VirtualDisplay.Callback#onStopped())`()` Called when the virtual display video projection has been stopped by the system.                                                                                   |

## Public constructors

### Callback

```
Callback()
```

## Public methods

### onPaused

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onPaused(): Unit
```

Called when the virtual display video projection has been paused by the system or when the surface has been detached by the application by calling setSurface(null). The surface will not receive any more buffers while paused.  

### onResumed

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onResumed(): Unit
```

Called when the virtual display video projection has been resumed after having been paused.  

### onStopped

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onStopped(): Unit
```

Called when the virtual display video projection has been stopped by the system. It will no longer receive frames and it will never be resumed. It is still the responsibility of the application to release() the virtual display.