Stay organized with collections
Save and categorize content based on your preferences.
WebHistoryItem
public
abstract
class
WebHistoryItem
extends Object
implements
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
|
getFavicon()
Return the favicon of this history item or null if no favicon was found.
|
abstract
String
|
getOriginalUrl()
Return the original url of this history item.
|
abstract
String
|
getTitle()
Return the document title of this history item.
|
abstract
String
|
getUrl()
Return the url of this history item.
|
Protected methods |
abstract
WebHistoryItem
|
clone()
Clone the history item for use by clients of WebView.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
WebHistoryItem
public WebHistoryItem ()
Public methods
getFavicon
public abstract Bitmap getFavicon ()
Return the favicon of this history item or null
if no favicon was found.
Returns |
Bitmap |
A Bitmap containing the favicon for this history item or null . |
getOriginalUrl
public abstract String getOriginalUrl ()
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.
Returns |
String |
The original url of this history item. |
getTitle
public abstract String getTitle ()
Return the document title of this history item.
Returns |
String |
The document title of this history item. |
getUrl
public abstract String getUrl ()
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.
Returns |
String |
The base url of this history item. |
Protected methods
clone
protected abstract WebHistoryItem clone ()
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.
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# WebHistoryItem\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Protected Methods](#promethods) \\| [Inherited Methods](#inhmethods) \n\nWebHistoryItem\n==============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/webkit/WebHistoryItem \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\nabstract\nclass\nWebHistoryItem\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\nimplements\n\n`[Cloneable](/reference/java/lang/Cloneable)`\n\n\n`\n\n|---|-------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.webkit.WebHistoryItem |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA convenience class for accessing fields in an entry in the back/forward list\nof a WebView. Each WebHistoryItem is a snapshot of the requested history\nitem. \n**See also:**\n\n- [WebBackForwardList](/reference/android/webkit/WebBackForwardList)\n\nSummary\n-------\n\n| ### Public constructors ||\n|-------------------------------------------------------------------------------------|---|\n| ` `[WebHistoryItem](/reference/android/webkit/WebHistoryItem#WebHistoryItem())`() ` |\n\n| ### Public methods ||\n|----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[Bitmap](/reference/android/graphics/Bitmap) | ` `[getFavicon](/reference/android/webkit/WebHistoryItem#getFavicon())`() ` Return the favicon of this history item or `null` if no favicon was found. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getOriginalUrl](/reference/android/webkit/WebHistoryItem#getOriginalUrl())`() ` Return the original url of this history item. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getTitle](/reference/android/webkit/WebHistoryItem#getTitle())`() ` Return the document title of this history item. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getUrl](/reference/android/webkit/WebHistoryItem#getUrl())`() ` Return the url of this history item. |\n\n| ### Protected methods ||\n|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[WebHistoryItem](/reference/android/webkit/WebHistoryItem) | ` `[clone](/reference/android/webkit/WebHistoryItem#clone())`() ` Clone the history item for use by clients of WebView. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nPublic constructors\n-------------------\n\n### WebHistoryItem\n\n```\npublic WebHistoryItem ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### getFavicon\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract Bitmap getFavicon ()\n```\n\nReturn the favicon of this history item or `null` if no favicon was found.\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------------------------------------------|-------------------------------------------------------------------------|\n| [Bitmap](/reference/android/graphics/Bitmap) | A Bitmap containing the favicon for this history item or `null`. \u003cbr /\u003e |\n\n### getOriginalUrl\n\nAdded in [API level 3](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getOriginalUrl ()\n```\n\nReturn the original url of this history item. This was the requested\nurl, the final url may be different as there might have been\nredirects while loading the site.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|-----------------------------------------------|\n| [String](/reference/java/lang/String) | The original url of this history item. \u003cbr /\u003e |\n\n### getTitle\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getTitle ()\n```\n\nReturn the document title of this history item.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|-------------------------------------------------|\n| [String](/reference/java/lang/String) | The document title of this history item. \u003cbr /\u003e |\n\n### getUrl\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getUrl ()\n```\n\nReturn the url of this history item. The url is the base url of this\nhistory item. See getTargetUrl() for the url that is the actual target of\nthis history item.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|-------------------------------------------|\n| [String](/reference/java/lang/String) | The base url of this history item. \u003cbr /\u003e |\n\nProtected methods\n-----------------\n\n### clone\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\nprotected abstract WebHistoryItem clone ()\n```\n\nClone the history item for use by clients of WebView. On Android 4.4 and later\nthere is no need to use this, as the object is already a read-only copy of the\ninternal state.\n\n\u003cbr /\u003e\n\n| Returns ||\n|------------------------------------------------------------|----------------------------------|\n| [WebHistoryItem](/reference/android/webkit/WebHistoryItem) | a clone of this instance. \u003cbr /\u003e |"]]