Stay organized with collections
Save and categorize content based on your preferences.
WebViewRenderProcessClient
abstract class WebViewRenderProcessClient
Used to receive callbacks on WebView
renderer events. WebViewRenderProcessClient instances may be set or retrieved via android.webkit.WebView#setWebViewRenderProcessClient(android.webkit.WebViewRenderProcessClient)
and android.webkit.WebView#getWebViewRenderProcessClient()
. Instances may be attached to multiple WebViews, and thus a single renderer event may cause a callback to be called multiple times with different WebView parameters.
Summary
Public methods |
abstract Unit |
Called once when an unresponsive renderer currently associated with view becomes responsive.
|
abstract Unit |
Called when the renderer currently associated with view becomes unresponsive as a result of a long running blocking task such as the execution of JavaScript.
|
Public constructors
WebViewRenderProcessClient
WebViewRenderProcessClient()
Public methods
onRenderProcessResponsive
abstract fun onRenderProcessResponsive(
view: WebView,
renderer: WebViewRenderProcess?
): Unit
Called once when an unresponsive renderer currently associated with view
becomes responsive.
After a WebView renderer becomes unresponsive, which is notified to the application by WebViewRenderProcessClient.onRenderProcessUnresponsive
, it is possible for the blocking renderer task to complete, returning the renderer to a responsive state. In that case, this method is called once to indicate responsiveness.
No action is taken by WebView as a result of this method call.
onRenderProcessUnresponsive
abstract fun onRenderProcessUnresponsive(
view: WebView,
renderer: WebViewRenderProcess?
): Unit
Called when the renderer currently associated with view
becomes unresponsive as a result of a long running blocking task such as the execution of JavaScript.
If a WebView fails to process an input event, or successfully navigate to a new URL within a reasonable time frame, the renderer is considered to be unresponsive, and this callback will be called.
This callback will continue to be called at regular intervals as long as the renderer remains unresponsive. If the renderer becomes responsive again, android.webkit.WebViewRenderProcessClient#onRenderProcessResponsive
will be called once, and this method will not subsequently be called unless another period of unresponsiveness is detected.
The minimum interval between successive calls to onRenderProcessUnresponsive
is 5 seconds.
No action is taken by WebView as a result of this method call. Applications may choose to terminate the associated renderer via the object that is passed to this callback, if in multiprocess mode, however this must be accompanied by correctly handling WebViewClient.onRenderProcessGone
for this WebView, and all other WebViews associated with the same renderer. Failure to do so will result in application termination.
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,["# WebViewRenderProcessClient\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nWebViewRenderProcessClient\n==========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/webkit/WebViewRenderProcessClient \"View this page in Java\") \n\n```\nabstract class WebViewRenderProcessClient\n```\n\n|---|------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.webkit.WebViewRenderProcessClient](#) |\n\nUsed to receive callbacks on [WebView](/reference/kotlin/android/webkit/WebView) renderer events. WebViewRenderProcessClient instances may be set or retrieved via [android.webkit.WebView#setWebViewRenderProcessClient(android.webkit.WebViewRenderProcessClient)](/reference/kotlin/android/webkit/WebView#setWebViewRenderProcessClient(android.webkit.WebViewRenderProcessClient)) and [android.webkit.WebView#getWebViewRenderProcessClient()](/reference/kotlin/android/webkit/WebView#getWebViewRenderProcessClient()). Instances may be attached to multiple WebViews, and thus a single renderer event may cause a callback to be called multiple times with different WebView parameters.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------|---|\n| [WebViewRenderProcessClient](#WebViewRenderProcessClient())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRenderProcessResponsive](#onRenderProcessResponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess))`(`view:` `[WebView](/reference/kotlin/android/webkit/WebView)`, `renderer:` `[WebViewRenderProcess](/reference/kotlin/android/webkit/WebViewRenderProcess)?`)` Called once when an unresponsive renderer currently associated with `view` becomes responsive. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRenderProcessUnresponsive](#onRenderProcessUnresponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess))`(`view:` `[WebView](/reference/kotlin/android/webkit/WebView)`, `renderer:` `[WebViewRenderProcess](/reference/kotlin/android/webkit/WebViewRenderProcess)?`)` Called when the renderer currently associated with `view` becomes unresponsive as a result of a long running blocking task such as the execution of JavaScript. |\n\nPublic constructors\n-------------------\n\n### WebViewRenderProcessClient\n\n```\nWebViewRenderProcessClient()\n```\n\nPublic methods\n--------------\n\n### onRenderProcessResponsive\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onRenderProcessResponsive(\n view: WebView, \n renderer: WebViewRenderProcess?\n): Unit\n```\n\nCalled once when an unresponsive renderer currently associated with `view` becomes responsive.\n\nAfter a WebView renderer becomes unresponsive, which is notified to the application by [WebViewRenderProcessClient.onRenderProcessUnresponsive](#onRenderProcessUnresponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)), it is possible for the blocking renderer task to complete, returning the renderer to a responsive state. In that case, this method is called once to indicate responsiveness.\n\nNo action is taken by WebView as a result of this method call.\n\n| Parameters ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `view` | [WebView](/reference/kotlin/android/webkit/WebView): The [WebView](/reference/kotlin/android/webkit/WebView) for which responsiveness was detected. This value cannot be `null`. |\n| `renderer` | [WebViewRenderProcess](/reference/kotlin/android/webkit/WebViewRenderProcess)?: The [WebViewRenderProcess](/reference/kotlin/android/webkit/WebViewRenderProcess) that has become responsive, or `null` if WebView is running in single process mode. |\n\n### onRenderProcessUnresponsive\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onRenderProcessUnresponsive(\n view: WebView, \n renderer: WebViewRenderProcess?\n): Unit\n```\n\nCalled when the renderer currently associated with `view` becomes unresponsive as a result of a long running blocking task such as the execution of JavaScript.\n\nIf a WebView fails to process an input event, or successfully navigate to a new URL within a reasonable time frame, the renderer is considered to be unresponsive, and this callback will be called.\n\nThis callback will continue to be called at regular intervals as long as the renderer remains unresponsive. If the renderer becomes responsive again, [android.webkit.WebViewRenderProcessClient#onRenderProcessResponsive](#onRenderProcessResponsive(android.webkit.WebView,%20android.webkit.WebViewRenderProcess)) will be called once, and this method will not subsequently be called unless another period of unresponsiveness is detected.\n\nThe minimum interval between successive calls to `onRenderProcessUnresponsive` is 5 seconds.\n\nNo action is taken by WebView as a result of this method call. Applications may choose to terminate the associated renderer via the object that is passed to this callback, if in multiprocess mode, however this must be accompanied by correctly handling [WebViewClient.onRenderProcessGone](/reference/kotlin/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)) for this WebView, and all other WebViews associated with the same renderer. Failure to do so will result in application termination.\n\n| Parameters ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `view` | [WebView](/reference/kotlin/android/webkit/WebView): The [WebView](/reference/kotlin/android/webkit/WebView) for which unresponsiveness was detected. This value cannot be `null`. |\n| `renderer` | [WebViewRenderProcess](/reference/kotlin/android/webkit/WebViewRenderProcess)?: The [WebViewRenderProcess](/reference/kotlin/android/webkit/WebViewRenderProcess) that has become unresponsive, or `null` if WebView is running in single process mode. |"]]