Stay organized with collections
Save and categorize content based on your preferences.
VsyncCallback
interface VsyncCallback
Implement this interface to receive a callback to start the next frame. The callback is invoked on the Looper
thread to which the Choreographer
is attached. The callback payload contains information about multiple possible frames, allowing choice of the appropriate frame based on latency requirements.
Summary
Public methods |
abstract Unit |
Called when a new display frame is being rendered.
|
Public methods
onVsync
abstract fun onVsync(data: Choreographer.FrameData): Unit
Called when a new display frame is being rendered.
Parameters |
data |
Choreographer.FrameData: The payload which includes frame information. Divide nanosecond values by 1000000 to convert it to the SystemClock.uptimeMillis() time base. data is not valid outside of onVsync and should not be accessed outside the callback. This value cannot be null . |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Choreographer.VsyncCallback\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nVsyncCallback\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/Choreographer.VsyncCallback \"View this page in Java\") \n\n```\ninterface VsyncCallback\n```\n\n|-----------------------------------------------|\n| [android.view.Choreographer.VsyncCallback](#) |\n\nImplement this interface to receive a callback to start the next frame. The callback is invoked on the [Looper](../os/Looper.html#) thread to which the [Choreographer](/reference/kotlin/android/view/Choreographer) is attached. The callback payload contains information about multiple possible frames, allowing choice of the appropriate frame based on latency requirements.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onVsync](#onVsync(android.view.Choreographer.FrameData))`(`data:` `[Choreographer.FrameData](/reference/kotlin/android/view/Choreographer.FrameData)`)` Called when a new display frame is being rendered. |\n\nPublic methods\n--------------\n\n### onVsync\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onVsync(data: Choreographer.FrameData): Unit\n```\n\nCalled when a new display frame is being rendered.\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `data` | [Choreographer.FrameData](/reference/kotlin/android/view/Choreographer.FrameData): The payload which includes frame information. Divide nanosecond values by `1000000` to convert it to the [SystemClock.uptimeMillis()](../os/SystemClock.html#uptimeMillis()) time base. `data` is not valid outside of `onVsync` and should not be accessed outside the callback. This value cannot be `null`. |\n\n**See Also**\n\n- [android.view.Choreographer.FrameCallback#doFrame](/reference/kotlin/android/view/Choreographer.FrameCallback#doFrame(kotlin.Long))"]]