Most visited

Recently visited

Added in API level 1
Deprecated since API level 18

WebIconDatabase

public abstract class WebIconDatabase
extends Object

java.lang.Object
   ↳ android.webkit.WebIconDatabase


This class was deprecated in API level 18.
This class is only required when running on devices up to JELLY_BEAN_MR2

Functions for manipulating the icon database used by WebView. These functions require that a WebView be constructed before being invoked and WebView.getIconDatabase() will return a WebIconDatabase object. This WebIconDatabase object is a single instance and all methods operate on that single object. The main use-case for this class is calling open(String) to enable favicon functionality on all WebView instances in this process.

Summary

Nested classes

interface WebIconDatabase.IconListener

This interface was deprecated in API level 18. This interface is obsolete.  

Public constructors

WebIconDatabase()

Public methods

abstract void close()

Close the shared instance of the icon database.

static WebIconDatabase getInstance()

Get the global instance of WebIconDatabase.

abstract void open(String path)

Open a the icon database and store the icons in the given path.

abstract void releaseIconForPageUrl(String url)

Release the icon for the given page url.

abstract void removeAllIcons()

Removes all the icons in the database.

abstract void requestIconForPageUrl(String url, WebIconDatabase.IconListener listener)

Request the Bitmap representing the icon for the given page url.

abstract void retainIconForPageUrl(String url)

Retain the icon for the given page url.

Inherited methods

From class java.lang.Object

Public constructors

WebIconDatabase

Added in API level 22
WebIconDatabase ()

Public methods

close

Added in API level 1
void close ()

Close the shared instance of the icon database.

getInstance

Added in API level 1
WebIconDatabase getInstance ()

Get the global instance of WebIconDatabase.

Returns
WebIconDatabase A single instance of WebIconDatabase. It will be the same instance for the current process each time this method is called.

open

Added in API level 1
void open (String path)

Open a the icon database and store the icons in the given path.

Parameters
path String: The directory path where the icon database will be stored.

releaseIconForPageUrl

Added in API level 1
void releaseIconForPageUrl (String url)

Release the icon for the given page url.

Parameters
url String: The page's url.

removeAllIcons

Added in API level 1
void removeAllIcons ()

Removes all the icons in the database.

requestIconForPageUrl

Added in API level 1
void requestIconForPageUrl (String url, 
                WebIconDatabase.IconListener listener)

Request the Bitmap representing the icon for the given page url. If the icon exists, the listener will be called with the result.

Parameters
url String: The page's url.
listener WebIconDatabase.IconListener: An implementation on IconListener to receive the result.

retainIconForPageUrl

Added in API level 1
void retainIconForPageUrl (String url)

Retain the icon for the given page url.

Parameters
url String: The page's url.

Hooray!