# WebIconDatabase

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/webkit/WebIconDatabase#nestedclasses)\|[Ctors](https://developer.android.com/reference/android/webkit/WebIconDatabase#pubctors)\|[Methods](https://developer.android.com/reference/android/webkit/WebIconDatabase#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/webkit/WebIconDatabase#inhmethods)  

# WebIconDatabase

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/webkit/WebIconDatabase "View this page in Kotlin")\|Java

`
public


abstract
class
WebIconDatabase
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.webkit.WebIconDatabase |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 18.**   
This class is only required when running on devices up to[Build.VERSION_CODES.JELLY_BEAN_MR2](https://developer.android.com/reference/android/os/Build.VERSION_CODES#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)](https://developer.android.com/reference/android/webkit/WebIconDatabase#open(java.lang.String))to enable favicon functionality on all WebView instances in this process.

## Summary

|                                                                                               ### Nested classes                                                                                               ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [WebIconDatabase.IconListener](https://developer.android.com/reference/android/webkit/WebIconDatabase.IconListener) *This interface was deprecated in API level 18. This interface is obsolete.* |

|                                                ### Public constructors                                                 ||
|---------------------------------------------------------------------------------------------------------------------|---|
| ` `[WebIconDatabase](https://developer.android.com/reference/android/webkit/WebIconDatabase#WebIconDatabase())`() ` |

|                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                              ||
|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void`                                                                                    | ` `[close](https://developer.android.com/reference/android/webkit/WebIconDatabase#close())`() ` Close the shared instance of the icon database.                                                                                                                                                                                                                                                                                                                         |
| ` static `[WebIconDatabase](https://developer.android.com/reference/android/webkit/WebIconDatabase) | ` `[getInstance](https://developer.android.com/reference/android/webkit/WebIconDatabase#getInstance())`() ` Get the global instance of WebIconDatabase.                                                                                                                                                                                                                                                                                                                 |
| ` abstract void`                                                                                    | ` `[open](https://developer.android.com/reference/android/webkit/WebIconDatabase#open(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` path) ` Open a the icon database and store the icons in the given path.                                                                                                                                                                                                                  |
| ` abstract void`                                                                                    | ` `[releaseIconForPageUrl](https://developer.android.com/reference/android/webkit/WebIconDatabase#releaseIconForPageUrl(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` url) ` Release the icon for the given page url.                                                                                                                                                                                                        |
| ` abstract void`                                                                                    | ` `[removeAllIcons](https://developer.android.com/reference/android/webkit/WebIconDatabase#removeAllIcons())`() ` Removes all the icons in the database.                                                                                                                                                                                                                                                                                                                |
| ` abstract void`                                                                                    | ` `[requestIconForPageUrl](https://developer.android.com/reference/android/webkit/WebIconDatabase#requestIconForPageUrl(java.lang.String,%20android.webkit.WebIconDatabase.IconListener))`(`[String](https://developer.android.com/reference/java/lang/String)` url, `[WebIconDatabase.IconListener](https://developer.android.com/reference/android/webkit/WebIconDatabase.IconListener)` listener) ` Request the Bitmap representing the icon for the given page url. |
| ` abstract void`                                                                                    | ` `[retainIconForPageUrl](https://developer.android.com/reference/android/webkit/WebIconDatabase#retainIconForPageUrl(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` url) ` Retain the icon for the given page url.                                                                                                                                                                                                           |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/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](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/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](https://developer.android.com/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](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### WebIconDatabase

```
public WebIconDatabase ()
```

<br />

<br />

## Public methods

### close

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void close ()
```

Close the shared instance of the icon database.

<br />

### getInstance

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static WebIconDatabase getInstance ()
```

Get the global instance of WebIconDatabase.

<br />

|                                                                                                            Returns                                                                                                            ||
|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| [WebIconDatabase](https://developer.android.com/reference/android/webkit/WebIconDatabase) | A single instance of WebIconDatabase. It will be the same instance for the current process each time this method is called. <br /> |

### open

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void open (String path)
```

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

<br />

|                                     Parameters                                      ||
|--------|-----------------------------------------------------------------------------|
| `path` | `String`: The directory path where the icon database will be stored. <br /> |

### releaseIconForPageUrl

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void releaseIconForPageUrl (String url)
```

Release the icon for the given page url.

<br />

|               Parameters                ||
|-------|----------------------------------|
| `url` | `String`: The page's url. <br /> |

### removeAllIcons

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void removeAllIcons ()
```

Removes all the icons in the database.

<br />

### requestIconForPageUrl

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract 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.

<br />

|                                                 Parameters                                                  ||
|------------|-------------------------------------------------------------------------------------------------|
| `url`      | `String`: The page's url. <br />                                                                |
| `listener` | `WebIconDatabase.IconListener`: An implementation on IconListener to receive the result. <br /> |

### retainIconForPageUrl

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void retainIconForPageUrl (String url)
```

Retain the icon for the given page url.

<br />

|               Parameters                ||
|-------|----------------------------------|
| `url` | `String`: The page's url. <br /> |