Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public 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

Class Overview

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 Methods
void close ()
Close the shared instance of the icon database.
static WebIconDatabase getInstance ()
Get the global instance of WebIconDatabase.
void open ( String path)
Open a the icon database and store the icons in the given path.
void releaseIconForPageUrl ( String url)
Release the icon for the given page url.
void removeAllIcons ()
Removes all the icons in the database.
void requestIconForPageUrl ( String url, WebIconDatabase.IconListener listener)
Request the Bitmap representing the icon for the given page url.
void retainIconForPageUrl ( String url)
Retain the icon for the given page url.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void close ()

Added in API level 1

Close the shared instance of the icon database.

public static WebIconDatabase getInstance ()

Added in API level 1

Get the global instance of WebIconDatabase.

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

public void open ( String path)

Added in API level 1

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

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

public void releaseIconForPageUrl ( String url)

Added in API level 1

Release the icon for the given page url.

Parameters
url The page's url.

public void removeAllIcons ()

Added in API level 1

Removes all the icons in the database.

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

Added in API level 1

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 The page's url.
listener An implementation on IconListener to receive the result.

public void retainIconForPageUrl ( String url)

Added in API level 1

Retain the icon for the given page url.

Parameters
url The page's url.