WebView.SetRendererPriorityPolicy(RendererPriority, Boolean) Method

Definition

Set the renderer priority policy for this WebView.

[Android.Runtime.Register("setRendererPriorityPolicy", "(IZ)V", "GetSetRendererPriorityPolicy_IZHandler", ApiSince=26)]
public virtual void SetRendererPriorityPolicy (Android.Webkit.RendererPriority rendererRequestedPriority, bool waivedWhenNotVisible);
[<Android.Runtime.Register("setRendererPriorityPolicy", "(IZ)V", "GetSetRendererPriorityPolicy_IZHandler", ApiSince=26)>]
abstract member SetRendererPriorityPolicy : Android.Webkit.RendererPriority * bool -> unit
override this.SetRendererPriorityPolicy : Android.Webkit.RendererPriority * bool -> unit

Parameters

rendererRequestedPriority
RendererPriority

the minimum priority at which this WebView desires the renderer process to be bound.

waivedWhenNotVisible
Boolean

if true, this flag specifies that when this WebView is not visible, it will be treated as if it had requested a priority of #RENDERER_PRIORITY_WAIVED.

Attributes

Remarks

Set the renderer priority policy for this WebView. The priority policy will be used to determine whether an out of process renderer should be considered to be a target for OOM killing.

Because a renderer can be associated with more than one WebView, the final priority it is computed as the maximum of any attached WebViews. When a WebView is destroyed it will cease to be considerered when calculating the renderer priority. Once no WebViews remain associated with the renderer, the priority of the renderer will be reduced to #RENDERER_PRIORITY_WAIVED.

The default policy is to set the priority to #RENDERER_PRIORITY_IMPORTANT regardless of visibility, and this should not be changed unless the caller also handles renderer crashes with WebViewClient#onRenderProcessGone. Any other setting will result in WebView renderers being killed by the system more aggressively than the application.

Java documentation for android.webkit.WebView.setRendererPriorityPolicy(int, boolean).

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