Share via


WindowManagerLayoutParams.PreferredRefreshRate Property

Definition

The preferred refresh rate for the window.

[Android.Runtime.Register("preferredRefreshRate")]
public float PreferredRefreshRate { get; set; }
[<Android.Runtime.Register("preferredRefreshRate")>]
member this.PreferredRefreshRate : single with get, set

Property Value

Attributes

Remarks

The preferred refresh rate for the window.

Before API 34, this must be one of the supported refresh rates obtained for the display(s) the window is on. The selected refresh rate will be applied to the display's default mode.

Starting API 34, this value is not limited to the supported refresh rates obtained from the display(s) for the window: it can be any refresh rate the window intends to run at. Any refresh rate can be provided as the preferred window refresh rate. The OS will select the refresh rate that best matches the #preferredRefreshRate.

Setting this value is the equivalent of calling Surface#setFrameRate with ( preferred_frame_rate, Surface#FRAME_RATE_COMPATIBILITY_DEFAULT, Surface#CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS). This should be used in favor of LayoutParams#preferredDisplayModeId for applications that want to specify the refresh rate, but do not want to specify a preference for any other displayMode properties (e.g., resolution).

This value is ignored if #preferredDisplayModeId is set.

Java documentation for android.view.WindowManager.LayoutParams.preferredRefreshRate.

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

See also