Page


class Page


This class serves solely as a key for Page-associated data. The instance itself functions as the key/identifier through equals and hashCode.

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

Summary

Public functions

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

Takes a snapshot of the page's state.

String

Returns the URL associated with this page instance.

Public functions

captureState

@AnyThread
@RequiresFeature(name = WebViewFeature.NAVIGATION_LISTENER_NAVIGATION_STATE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun captureState(): PageState

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
PageState

The immutable PageState object.

Throws
java.lang.UnsupportedOperationException

if the NAVIGATION_LISTENER_NAVIGATION_STATE feature is not supported. This should be checked before use with isFeatureSupported.

getUrl

Added in 1.16.0
fun getUrl(): String

Returns the URL associated with this page instance.