Stay organized with collections
Save and categorize content based on your preferences.
JsResult
open class JsResult
An instance of this class is passed as a parameter in various WebChromeClient
action notifications. The object is used as a handle onto the underlying JavaScript-originated request, and provides a means for the client to indicate whether this action should proceed.
Summary
Public methods |
Unit |
Handle the result if the user cancelled the dialog.
|
Unit |
Handle a confirmation response from the user.
|
Public methods
cancel
fun cancel(): Unit
Handle the result if the user cancelled the dialog.
confirm
fun confirm(): Unit
Handle a confirmation response from the user.
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# JsResult\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nJsResult\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/webkit/JsResult \"View this page in Java\") \n\n```\nopen class JsResult\n```\n\n|---|------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.webkit.JsResult](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [JsPromptResult](/reference/kotlin/android/webkit/JsPromptResult) |-------------------------------------------------------------------|-------------------------------------------------------| | [JsPromptResult](/reference/kotlin/android/webkit/JsPromptResult) | Public class for handling JavaScript prompt requests. | |\n\nAn instance of this class is passed as a parameter in various [WebChromeClient](/reference/kotlin/android/webkit/WebChromeClient) action notifications. The object is used as a handle onto the underlying JavaScript-originated request, and provides a means for the client to indicate whether this action should proceed.\n\nSummary\n-------\n\n| Public methods ||\n|------------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [cancel](#cancel())`()` Handle the result if the user cancelled the dialog. |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [confirm](#confirm())`()` Handle a confirmation response from the user. |\n\nPublic methods\n--------------\n\n### cancel\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun cancel(): Unit\n```\n\nHandle the result if the user cancelled the dialog. \n\n### confirm\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun confirm(): Unit\n```\n\nHandle a confirmation response from the user."]]