# Page

Artifact: [androidx.webkit:webkit](https://developer.android.com/jetpack/androidx/releases/webkit) [View Source](https://cs.android.com/search?q=file:androidx/webkit/Page.java+class:androidx.webkit.Page) Added in [1.14.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.14.0)

*** ** * ** ***


```
public final class Page
```

<br />

*** ** * ** ***

This class serves solely as a key for Page-associated data. The instance itself functions as the key/identifier through `https://developer.android.com/reference/java/lang/Object.html#equals(java.lang.Object)` and `https://developer.android.com/reference/java/lang/Object.html#hashCode()`.

In the following circumstances, multiple navigations may result in the same Page:

- Same-document navigations when `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER_NON_NULL_PAGE_FOR_SAME_DOCUMENT_NAVIGATIONS()` is supported.
- Back or forward navigations that result in the user returning to a previously loaded page when `https://developer.android.com/reference/androidx/webkit/WebSettingsCompat#setBackForwardCacheEnabled(android.webkit.WebSettings,boolean)` is enabled.

## Summary

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState` | `@https://developer.android.com/reference/androidx/annotation/AnyThread @https://developer.android.com/reference/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/androidx/webkit/WebViewFeature.NAVIGATION_LISTENER_NAVIGATION_STATE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") https://developer.android.com/reference/androidx/webkit/Page#captureState()()` Takes a snapshot of the page's state. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/webkit/Page#getUrl()()` Returns the URL associated with this page instance. |

## Public methods

### captureState

Added in [1.19.0-alpha01](https://developer.android.com/jetpack/androidx/releases/webkit#1.19.0-alpha01)

```
@AnyThread
@RequiresFeature(name = WebViewFeature.NAVIGATION_LISTENER_NAVIGATION_STATE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
public @NonNull PageState captureState()
```

Takes a snapshot of the page's state. This allows you to hold a consistent representation of the page at a certain point in time, as the Page object gets updated as the navigation progresses.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/webkit/PageState` | The immutable `https://developer.android.com/reference/androidx/webkit/PageState` object. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/androidx/webkit/WebViewFeature#NAVIGATION_LISTENER_NAVIGATION_STATE()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getUrl

Added in [1.16.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.16.0)

```
public @NonNull String getUrl()
```

Returns the URL associated with this page instance.