Stay organized with collections
Save and categorize content based on your preferences.
Callback
abstract class Callback
Interface for receiving information about a VirtualDisplay
's state changes.
Summary
Public methods |
open 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).
|
open Unit |
Called when the virtual display video projection has been resumed after having been paused.
|
open Unit |
Called when the virtual display video projection has been stopped by the system.
|
Public constructors
Public methods
onPaused
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
open fun onResumed(): Unit
Called when the virtual display video projection has been resumed after having been paused.
onStopped
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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# VirtualDisplay.Callback\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCallback\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/hardware/display/VirtualDisplay.Callback \"View this page in Java\") \n\n```\nabstract class Callback\n```\n\n|---|-------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.hardware.display.VirtualDisplay.Callback](#) |\n\nInterface for receiving information about a [VirtualDisplay](/reference/kotlin/android/hardware/display/VirtualDisplay)'s state changes.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------|---|\n| [Callback](#Callback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onPaused](#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). |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onResumed](#onResumed())`()` Called when the virtual display video projection has been resumed after having been paused. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStopped](#onStopped())`()` Called when the virtual display video projection has been stopped by the system. |\n\nPublic constructors\n-------------------\n\n### Callback\n\n```\nCallback()\n```\n\nPublic methods\n--------------\n\n### onPaused\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onPaused(): Unit\n```\n\nCalled 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. \n\n### onResumed\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onResumed(): Unit\n```\n\nCalled when the virtual display video projection has been resumed after having been paused. \n\n### onStopped\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onStopped(): Unit\n```\n\nCalled 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."]]