Stay organized with collections
Save and categorize content based on your preferences.
JsPromptResult
open class JsPromptResult : JsResult
Public class for handling JavaScript prompt requests. The WebChromeClient will receive a WebChromeClient.onJsPrompt(WebView, String, String, String, JsPromptResult)
call with a JsPromptResult instance as a parameter. This parameter is used to return the result of this user dialog prompt back to the WebView instance. The client can call cancel() to cancel the dialog or confirm() with the user's input to confirm the dialog.
Summary
Public methods |
open Unit |
Handle a confirmation response from the user.
|
Inherited functions |
From class JsResult
Unit |
cancel()
Handle the result if the user cancelled the dialog.
|
Unit |
confirm()
Handle a confirmation response from the user.
|
|
Public methods
confirm
open fun confirm(result: String!): 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,["# JsPromptResult\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nJsPromptResult\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/webkit/JsPromptResult \"View this page in Java\") \n\n```\nopen class JsPromptResult : JsResult\n```\n\n|---|---|------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [android.webkit.JsResult](/reference/kotlin/android/webkit/JsResult) ||\n| | ↳ | [android.webkit.JsPromptResult](#) |\n\nPublic class for handling JavaScript prompt requests. The WebChromeClient will receive a [WebChromeClient.onJsPrompt(WebView, String, String, String, JsPromptResult)](/reference/kotlin/android/webkit/WebChromeClient#onJsPrompt(android.webkit.WebView,%20kotlin.String,%20kotlin.String,%20kotlin.String,%20android.webkit.JsPromptResult)) call with a JsPromptResult instance as a parameter. This parameter is used to return the result of this user dialog prompt back to the WebView instance. The client can call cancel() to cancel the dialog or confirm() with the user's input to confirm the dialog.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [confirm](#confirm(kotlin.String))`(`result:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Handle a confirmation response from the user. |\n\n| Inherited functions ||\n|---|---|\n| From class [JsResult](/reference/kotlin/android/webkit/JsResult) |------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [cancel](/reference/kotlin/android/webkit/JsResult#cancel())`()` Handle the result if the user cancelled the dialog. \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [confirm](/reference/kotlin/android/webkit/JsResult#confirm())`()` Handle a confirmation response from the user. \u003cbr /\u003e | ||\n\nPublic methods\n--------------\n\n### confirm\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun confirm(result: String!): Unit\n```\n\nHandle a confirmation response from the user."]]