Share via


Window.IOnFrameMetricsAvailableListener.OnFrameMetricsAvailable Method

Definition

Called when information is available for the previously rendered frame.

[Android.Runtime.Register("onFrameMetricsAvailable", "(Landroid/view/Window;Landroid/view/FrameMetrics;I)V", "GetOnFrameMetricsAvailable_Landroid_view_Window_Landroid_view_FrameMetrics_IHandler:Android.Views.Window/IOnFrameMetricsAvailableListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
public void OnFrameMetricsAvailable (Android.Views.Window? window, Android.Views.FrameMetrics? frameMetrics, int dropCountSinceLastInvocation);
[<Android.Runtime.Register("onFrameMetricsAvailable", "(Landroid/view/Window;Landroid/view/FrameMetrics;I)V", "GetOnFrameMetricsAvailable_Landroid_view_Window_Landroid_view_FrameMetrics_IHandler:Android.Views.Window/IOnFrameMetricsAvailableListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
abstract member OnFrameMetricsAvailable : Android.Views.Window * Android.Views.FrameMetrics * int -> unit

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 <strong>this reference is not valid outside the scope of this method</strong>.

dropCountSinceLastInvocation
Int32

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

Attributes

Remarks

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(FrameMetrics) within this method and defer additional computation or storage to another thread to avoid unnecessarily dropping reports.

Java documentation for android.view.Window.OnFrameMetricsAvailableListener.onFrameMetricsAvailable(android.view.Window, android.view.FrameMetrics, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to