Stay organized with collections
Save and categorize content based on your preferences.
HitTestResult
open class HitTestResult
Summary
Constants |
static Int |
|
static Int |
HitTestResult for hitting an edit text area.
|
static Int |
HitTestResult for hitting an email address.
|
static Int |
HitTestResult for hitting a map address.
|
static Int |
|
static Int |
HitTestResult for hitting an HTML::img tag.
|
static Int |
HitTestResult for hitting a phone number.
|
static Int |
HitTestResult for hitting a HTML::a tag with src=http.
|
static Int |
HitTestResult for hitting a HTML::a tag with src=http + HTML::img.
|
static Int |
Default HitTestResult, where the target is unknown.
|
Public methods |
open String? |
Gets additional type-dependant information about the result.
|
open Int |
Gets the type of the hit test result.
|
Constants
ANCHOR_TYPE
static val ANCHOR_TYPE: Int
Deprecated: This type is no longer used.
Value: 1
EDIT_TEXT_TYPE
static val EDIT_TEXT_TYPE: Int
HitTestResult for hitting an edit text area.
Value: 9
EMAIL_TYPE
static val EMAIL_TYPE: Int
HitTestResult for hitting an email address.
Value: 4
GEO_TYPE
static val GEO_TYPE: Int
HitTestResult for hitting a map address.
Value: 3
IMAGE_ANCHOR_TYPE
static val IMAGE_ANCHOR_TYPE: Int
Deprecated: This type is no longer used.
Value: 6
IMAGE_TYPE
static val IMAGE_TYPE: Int
HitTestResult for hitting an HTML::img tag.
Value: 5
PHONE_TYPE
static val PHONE_TYPE: Int
HitTestResult for hitting a phone number.
Value: 2
SRC_ANCHOR_TYPE
static val SRC_ANCHOR_TYPE: Int
HitTestResult for hitting a HTML::a tag with src=http.
Value: 7
SRC_IMAGE_ANCHOR_TYPE
static val SRC_IMAGE_ANCHOR_TYPE: Int
HitTestResult for hitting a HTML::a tag with src=http + HTML::img.
Value: 8
UNKNOWN_TYPE
static val UNKNOWN_TYPE: Int
Default HitTestResult, where the target is unknown.
Value: 0
Public methods
open fun getExtra(): String?
Gets additional type-dependant information about the result. See WebView.getHitTestResult()
for details. May either be null
or contain extra information about this result.
Return |
String? |
additional type-dependant information about the result |
getType
open fun getType(): Int
Gets the type of the hit test result. See the XXX_TYPE constants defined in this class.
Return |
Int |
the type of the hit test result |
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,["# WebView.HitTestResult\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nHitTestResult\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/webkit/WebView.HitTestResult \"View this page in Java\") \n\n```\nopen class HitTestResult\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.webkit.WebView.HitTestResult](#) |\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ANCHOR_TYPE](#ANCHOR_TYPE:kotlin.Int) \u003cbr /\u003e |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EDIT_TEXT_TYPE](#EDIT_TEXT_TYPE:kotlin.Int) HitTestResult for hitting an edit text area. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EMAIL_TYPE](#EMAIL_TYPE:kotlin.Int) HitTestResult for hitting an email address. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [GEO_TYPE](#GEO_TYPE:kotlin.Int) HitTestResult for hitting a map address. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [IMAGE_ANCHOR_TYPE](#IMAGE_ANCHOR_TYPE:kotlin.Int) \u003cbr /\u003e |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [IMAGE_TYPE](#IMAGE_TYPE:kotlin.Int) HitTestResult for hitting an HTML::img tag. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PHONE_TYPE](#PHONE_TYPE:kotlin.Int) HitTestResult for hitting a phone number. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SRC_ANCHOR_TYPE](#SRC_ANCHOR_TYPE:kotlin.Int) HitTestResult for hitting a HTML::a tag with src=http. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SRC_IMAGE_ANCHOR_TYPE](#SRC_IMAGE_ANCHOR_TYPE:kotlin.Int) HitTestResult for hitting a HTML::a tag with src=http + HTML::img. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UNKNOWN_TYPE](#UNKNOWN_TYPE:kotlin.Int) Default HitTestResult, where the target is unknown. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | [getExtra](#getExtra())`()` Gets additional type-dependant information about the result. |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getType](#getType())`()` Gets the type of the hit test result. |\n\nConstants\n---------\n\n### ANCHOR_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ANCHOR_TYPE: Int\n```\n\n**Deprecated:** *This type is no longer used.* \n\n Value: 1\n\n### EDIT_TEXT_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EDIT_TEXT_TYPE: Int\n```\n\nHitTestResult for hitting an edit text area. \n\n Value: 9\n\n### EMAIL_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EMAIL_TYPE: Int\n```\n\nHitTestResult for hitting an email address. \n\n Value: 4\n\n### GEO_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val GEO_TYPE: Int\n```\n\nHitTestResult for hitting a map address. \n\n Value: 3\n\n### IMAGE_ANCHOR_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val IMAGE_ANCHOR_TYPE: Int\n```\n\n**Deprecated:** *This type is no longer used.* \n\n Value: 6\n\n### IMAGE_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val IMAGE_TYPE: Int\n```\n\nHitTestResult for hitting an HTML::img tag. \n\n Value: 5\n\n### PHONE_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val PHONE_TYPE: Int\n```\n\nHitTestResult for hitting a phone number. \n\n Value: 2\n\n### SRC_ANCHOR_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SRC_ANCHOR_TYPE: Int\n```\n\nHitTestResult for hitting a HTML::a tag with src=http. \n\n Value: 7\n\n### SRC_IMAGE_ANCHOR_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SRC_IMAGE_ANCHOR_TYPE: Int\n```\n\nHitTestResult for hitting a HTML::a tag with src=http + HTML::img. \n\n Value: 8\n\n### UNKNOWN_TYPE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val UNKNOWN_TYPE: Int\n```\n\nDefault HitTestResult, where the target is unknown. \n\n Value: 0\n\nPublic methods\n--------------\n\n### getExtra\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getExtra(): String?\n```\n\nGets additional type-dependant information about the result. See [WebView.getHitTestResult()](/reference/kotlin/android/webkit/WebView#getHitTestResult()) for details. May either be `null` or contain extra information about this result.\n\n| Return ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | additional type-dependant information about the result |\n\n### getType\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getType(): Int\n```\n\nGets the type of the hit test result. See the XXX_TYPE constants defined in this class.\n\n| Return ||\n|----------------------------------------------------------------------------|---------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the type of the hit test result |"]]