FileDocCategorySizeDatePackage
WebHistoryItem.javaAPI DocAndroid 1.5 API5570Wed May 06 22:41:56 BST 2009android.webkit

WebHistoryItem

public 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. Each history item may be updated during the load of a page.
see
WebBackForwardList

Fields Summary
private static int
sNextId
private final int
mId
private String
mTitle
private String
mUrl
private String
mOriginalUrl
private android.graphics.Bitmap
mFavicon
private byte[]
mFlattenedData
Constructors Summary
private WebHistoryItem()
Basic constructor that assigns a unique id to the item. Called by JNI only.


                       
      
        synchronized (WebHistoryItem.class) {
            mId = sNextId++;
        }
    
WebHistoryItem(byte[] data)
Construct a new WebHistoryItem with initial flattened data.

param
data The pre-flattened data coming from restoreState.

        mUrl = null; // This will be updated natively
        mFlattenedData = data;
        synchronized (WebHistoryItem.class) {
            mId = sNextId++;
        }
    
private WebHistoryItem(WebHistoryItem item)
Construct a clone of a WebHistoryItem from the given item.

param
item The history item to clone.

        mUrl = item.mUrl;
        mTitle = item.mTitle;
        mFlattenedData = item.mFlattenedData;
        mFavicon = item.mFavicon;
        mId = item.mId;
Methods Summary
protected synchronized android.webkit.WebHistoryItemclone()
Clone the history item for use by clients of WebView.

        return new WebHistoryItem(this);
    
public android.graphics.BitmapgetFavicon()
Return the favicon of this history item or null if no favicon was found.

return
A Bitmap containing the favicon for this history item or null. Note: The VM ensures 32-bit atomic read/write operations so we don't have to synchronize this method.

        return mFavicon;
    
byte[]getFlattenedData()
Get the pre-flattened data. Note: The VM ensures 32-bit atomic read/write operations so we don't have to synchronize this method.

        return mFlattenedData;
    
public intgetId()
Return an identifier for this history item. If an item is a copy of another item, the identifiers will be the same even if they are not the same object.

return
The id for this item.

        return mId;
    
public java.lang.StringgetOriginalUrl()
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
The original url of this history item.

        return mOriginalUrl;
    
public java.lang.StringgetTitle()
Return the document title of this history item.

return
The document title of this history item. Note: The VM ensures 32-bit atomic read/write operations so we don't have to synchronize this method.

        return mTitle;
    
public java.lang.StringgetUrl()
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
The base url of this history item. Note: The VM ensures 32-bit atomic read/write operations so we don't have to synchronize this method.

        return mUrl;
    
voidinflate(int nativeFrame)
Inflate this item. Note: The VM ensures 32-bit atomic read/write operations so we don't have to synchronize this method.

        inflate(nativeFrame, mFlattenedData);
    
private native voidinflate(int nativeFrame, byte[] data)

voidsetFavicon(android.graphics.Bitmap icon)
Set the favicon.

param
icon A Bitmap containing the favicon for this history item. Note: The VM ensures 32-bit atomic read/write operations so we don't have to synchronize this method.

        mFavicon = icon;
    
private voidupdate(java.lang.String url, java.lang.String originalUrl, java.lang.String title, android.graphics.Bitmap favicon, byte[] data)

        mUrl = url;
        mOriginalUrl = originalUrl;
        mTitle = title;
        mFavicon = favicon;
        mFlattenedData = data;