# WebView.HitTestResult

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# HitTestResult

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/webkit/WebView.HitTestResult "View this page in Java")  

```
open class HitTestResult
```

|---|------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                               ||
| ↳ | [android.webkit.WebView.HitTestResult](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#) |

## Summary

|                                                                                                                                             Constants                                                                                                                                              ||
|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ANCHOR_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#ANCHOR_TYPE:kotlin.Int) <br />                                                                                 |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EDIT_TEXT_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#EDIT_TEXT_TYPE:kotlin.Int) HitTestResult for hitting an edit text area.                                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EMAIL_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#EMAIL_TYPE:kotlin.Int) HitTestResult for hitting an email address.                                              |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [GEO_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#GEO_TYPE:kotlin.Int) HitTestResult for hitting a map address.                                                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [IMAGE_ANCHOR_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#IMAGE_ANCHOR_TYPE:kotlin.Int) <br />                                                                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [IMAGE_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#IMAGE_TYPE:kotlin.Int) HitTestResult for hitting an HTML::img tag.                                              |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PHONE_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#PHONE_TYPE:kotlin.Int) HitTestResult for hitting a phone number.                                                |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SRC_ANCHOR_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#SRC_ANCHOR_TYPE:kotlin.Int) HitTestResult for hitting a HTML::a tag with src=http.                         |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SRC_IMAGE_ANCHOR_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#SRC_IMAGE_ANCHOR_TYPE:kotlin.Int) HitTestResult for hitting a HTML::a tag with src=http + HTML::img. |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UNKNOWN_TYPE](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#UNKNOWN_TYPE:kotlin.Int) Default HitTestResult, where the target is unknown.                                  |

|                                                                                                                           Public methods                                                                                                                           ||
|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | [getExtra](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#getExtra())`()` Gets additional type-dependant information about the result. |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)        | [getType](https://developer.android.com/reference/kotlin/android/webkit/WebView.HitTestResult#getType())`()` Gets the type of the hit test result.                          |

## Constants

### ANCHOR_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val ANCHOR_TYPE: Int
```

**Deprecated:** *This type is no longer used.*  

    Value: 1

### EDIT_TEXT_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EDIT_TEXT_TYPE: Int
```

HitTestResult for hitting an edit text area.  

    Value: 9

### EMAIL_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EMAIL_TYPE: Int
```

HitTestResult for hitting an email address.  

    Value: 4

### GEO_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val GEO_TYPE: Int
```

HitTestResult for hitting a map address.  

    Value: 3

### IMAGE_ANCHOR_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val IMAGE_ANCHOR_TYPE: Int
```

**Deprecated:** *This type is no longer used.*  

    Value: 6

### IMAGE_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val IMAGE_TYPE: Int
```

HitTestResult for hitting an HTML::img tag.  

    Value: 5

### PHONE_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val PHONE_TYPE: Int
```

HitTestResult for hitting a phone number.  

    Value: 2

### SRC_ANCHOR_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SRC_ANCHOR_TYPE: Int
```

HitTestResult for hitting a HTML::a tag with src=http.  

    Value: 7

### SRC_IMAGE_ANCHOR_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SRC_IMAGE_ANCHOR_TYPE: Int
```

HitTestResult for hitting a HTML::a tag with src=http + HTML::img.  

    Value: 8

### UNKNOWN_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val UNKNOWN_TYPE: Int
```

Default HitTestResult, where the target is unknown.  

    Value: 0

## Public methods

### getExtra

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getExtra(): String?
```

Gets additional type-dependant information about the result. See[WebView.getHitTestResult()](https://developer.android.com/reference/kotlin/android/webkit/WebView#getHitTestResult())for details. May either be`null`or contain extra information about this result.

|                                                                  Return                                                                   ||
|-----------------------------------------------------------------------------------|--------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | additional type-dependant information about the result |

### getType

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getType(): Int
```

Gets the type of the hit test result. See the XXX_TYPE constants defined in this class.

|                                                   Return                                                    ||
|----------------------------------------------------------------------------|---------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the type of the hit test result |