Stay organized with collections
Save and categorize content based on your preferences.
WebHistoryItem
abstract class WebHistoryItem : Cloneable
A convenience class for accessing fields in an entry in the back/forward list of a WebView. Each WebHistoryItem is a snapshot of the requested history item.
Summary
Public methods |
abstract Bitmap? |
Return the favicon of this history item or null if no favicon was found.
|
abstract String! |
Return the original url of this history item.
|
abstract String! |
Return the document title of this history item.
|
abstract String! |
Return the url of this history item.
|
Protected methods |
abstract WebHistoryItem |
Clone the history item for use by clients of WebView.
|
Public constructors
WebHistoryItem
WebHistoryItem()
Public methods
getFavicon
abstract fun getFavicon(): Bitmap?
Return the favicon of this history item or null
if no favicon was found.
Return |
Bitmap? |
A Bitmap containing the favicon for this history item or null . |
getOriginalUrl
abstract fun getOriginalUrl(): String!
Return the original url of this history item. This was the requested url, the final url may be different as there might have been redirects while loading the site.
Return |
String! |
The original url of this history item. |
getTitle
abstract fun getTitle(): String!
Return the document title of this history item.
Return |
String! |
The document title of this history item. |
getUrl
abstract fun getUrl(): String!
Return the url of this history item. The url is the base url of this history item. See getTargetUrl() for the url that is the actual target of this history item.
Return |
String! |
The base url of this history item. |
Protected methods
clone
protected abstract fun clone(): WebHistoryItem
Clone the history item for use by clients of WebView. On Android 4.4 and later there is no need to use this, as the object is already a read-only copy of the internal state.
Exceptions |
java.lang.CloneNotSupportedException |
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned. |
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,["# WebHistoryItem\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nWebHistoryItem\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/webkit/WebHistoryItem \"View this page in Java\") \n\n```\nabstract class WebHistoryItem : Cloneable\n```\n\n|---|------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.webkit.WebHistoryItem](#) |\n\nA convenience class for accessing fields in an entry in the back/forward list of a WebView. Each WebHistoryItem is a snapshot of the requested history item.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------|---|\n| [WebHistoryItem](#WebHistoryItem())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|\n| abstract [Bitmap](../graphics/Bitmap.html#)? | [getFavicon](#getFavicon())`()` Return the favicon of this history item or `null` if no favicon was found. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getOriginalUrl](#getOriginalUrl())`()` Return the original url of this history item. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getTitle](#getTitle())`()` Return the document title of this history item. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getUrl](#getUrl())`()` Return the url of this history item. |\n\n| Protected methods ||\n|------------------------------|-----------------------------------------------------------------------------|\n| abstract [WebHistoryItem](#) | [clone](#clone())`()` Clone the history item for use by clients of WebView. |\n\nPublic constructors\n-------------------\n\n### WebHistoryItem\n\n```\nWebHistoryItem()\n```\n\nPublic methods\n--------------\n\n### getFavicon\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getFavicon(): Bitmap?\n```\n\nReturn the favicon of this history item or `null` if no favicon was found.\n\n| Return ||\n|-------------------------------------|------------------------------------------------------------------|\n| [Bitmap](../graphics/Bitmap.html#)? | A Bitmap containing the favicon for this history item or `null`. |\n\n### getOriginalUrl\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getOriginalUrl(): String!\n```\n\nReturn the original url of this history item. This was the requested url, the final url may be different as there might have been redirects while loading the site.\n\n| Return ||\n|-----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The original url of this history item. |\n\n### getTitle\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getTitle(): String!\n```\n\nReturn the document title of this history item.\n\n| Return ||\n|-----------------------------------------------------------------------------------|------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The document title of this history item. |\n\n### getUrl\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getUrl(): String!\n```\n\nReturn the url of this history item. The url is the base url of this history item. See getTargetUrl() for the url that is the actual target of this history item.\n\n| Return ||\n|-----------------------------------------------------------------------------------|------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The base url of this history item. |\n\nProtected methods\n-----------------\n\n### clone\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected abstract fun clone(): WebHistoryItem\n```\n\nClone the history item for use by clients of WebView. On Android 4.4 and later there is no need to use this, as the object is already a read-only copy of the internal state.\n\n| Return ||\n|---------------------|---------------------------|\n| [WebHistoryItem](#) | a clone of this instance. |\n\n| Exceptions ||\n|----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `java.lang.CloneNotSupportedException` | if the object's class does not support the `Cloneable` interface. Subclasses that override the `clone` method can also throw this exception to indicate that an instance cannot be cloned. |"]]