Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

WebBackForwardList

public abstract class WebBackForwardList
extends Object implements Cloneable, Serializable

java.lang.Object
   ↳ android.webkit.WebBackForwardList


This class contains the back/forward list for a WebView. WebView.copyBackForwardList() will return a copy of this class used to inspect the entries in the list.

Summary

Public constructors

WebBackForwardList()

Public methods

abstract int getCurrentIndex()

Get the index of the current history item.

abstract WebHistoryItem getCurrentItem()

Return the current history item.

abstract WebHistoryItem getItemAtIndex(int index)

Get the history item at the given index.

abstract int getSize()

Get the total size of the back/forward list.

Protected methods

abstract WebBackForwardList clone()

Clone the entire object to be used in the UI thread by clients of WebView.

Inherited methods

Public constructors

WebBackForwardList

added in API level 22
public WebBackForwardList ()

Public methods

getCurrentIndex

added in API level 1
public abstract int getCurrentIndex ()

Get the index of the current history item. This index can be used to directly index into the array list.

Returns
int The current index from 0...n or -1 if the list is empty.

getCurrentItem

added in API level 1
public abstract WebHistoryItem getCurrentItem ()

Return the current history item. This method returns null if the list is empty.

Returns
WebHistoryItem The current history item.

This value may be null.

getItemAtIndex

added in API level 1
public abstract WebHistoryItem getItemAtIndex (int index)

Get the history item at the given index. The index range is from 0...n where 0 is the first item and n is the last item.

Parameters
index int: The index to retrieve.

Returns
WebHistoryItem

getSize

added in API level 1
public abstract int getSize ()

Get the total size of the back/forward list.

Returns
int The size of the list.

Protected methods

clone

added in API level 1
protected abstract WebBackForwardList clone ()

Clone the entire object to be used in the UI thread by clients of WebView. This creates a copy that should never be modified by any of the webkit package classes.

Returns
WebBackForwardList a clone of this instance.