Skip to content

Most visited

Recently visited

navigation
added in API level 24

Window.OnFrameMetricsAvailableListener

public static interface Window.OnFrameMetricsAvailableListener

android.view.Window.OnFrameMetricsAvailableListener


Callback for clients that want frame timing information for each frame rendered by the Window.

Summary

Public methods

abstract void onFrameMetricsAvailable(Window window, FrameMetrics frameMetrics, int dropCountSinceLastInvocation)

Called when information is available for the previously rendered frame.

Public methods

onFrameMetricsAvailable

added in API level 24
void onFrameMetricsAvailable (Window window, 
                FrameMetrics frameMetrics, 
                int dropCountSinceLastInvocation)

Called when information is available for the previously rendered frame. Reports can be dropped if this callback takes too long to execute, as the report producer cannot wait for the consumer to complete. It is highly recommended that clients copy the passed in FrameMetrics via FrameMetrics(FrameMetrics) within this method and defer additional computation or storage to another thread to avoid unnecessarily dropping reports.

Parameters
window Window: The Window on which the frame was displayed.

frameMetrics FrameMetrics: the available metrics. This object is reused on every call and thus this reference is not valid outside the scope of this method.

dropCountSinceLastInvocation int: the number of reports dropped since the last time this callback was invoked.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)