Stay organized with collections
Save and categorize content based on your preferences.
Choreographer.VsyncCallback
public
static
interface
Choreographer.VsyncCallback
android.view.Choreographer.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
onVsync
public abstract void onVsync (Choreographer.FrameData data)
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.
[[["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,["# Choreographer.VsyncCallback\n\nAdded in [API level 33](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nChoreographer.VsyncCallback\n===========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/view/Choreographer.VsyncCallback \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nChoreographer.VsyncCallback\n`\n\n\n`\n\n\n`\n\n|------------------------------------------|\n| android.view.Choreographer.VsyncCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nImplement this interface to receive a callback to start the next frame. The callback is\ninvoked on the [Looper](/reference/android/os/Looper) thread to which the [Choreographer](/reference/android/view/Choreographer) is attached. The\ncallback payload contains information about multiple possible frames, allowing choice of\nthe appropriate frame based on latency requirements. \n**See also:**\n\n- [Choreographer.FrameCallback](/reference/android/view/Choreographer.FrameCallback)\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onVsync](/reference/android/view/Choreographer.VsyncCallback#onVsync(android.view.Choreographer.FrameData))`(`[Choreographer.FrameData](/reference/android/view/Choreographer.FrameData)` data) ` Called when a new display frame is being rendered. |\n\nPublic methods\n--------------\n\n### onVsync\n\nAdded in [API level 33](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onVsync (Choreographer.FrameData data)\n```\n\nCalled when a new display frame is being rendered.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `data` | `Choreographer.FrameData`: The payload which includes frame information. Divide nanosecond values by `1000000` to convert it to the [SystemClock.uptimeMillis()](/reference/android/os/SystemClock#uptimeMillis()) time base. `data` is not valid outside of `onVsync` and should not be accessed outside the callback. This value cannot be `null`. \u003cbr /\u003e |\n\n**See also:**\n\n- [Choreographer.FrameCallback.doFrame(long)](/reference/android/view/Choreographer.FrameCallback#doFrame(long))"]]