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

# WebSettings

*** ** * ** ***

` public abstract class WebSettings `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

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

<br />

*** ** * ** ***

Manages settings state for a WebView. When a WebView is first created, it obtains a set of default settings. These default settings will be returned from any getter call. A `WebSettings` object obtained from `https://developer.android.com/reference/android/webkit/WebView#getSettings()` is tied to the life of the WebView. If a WebView has been destroyed, any method call on `WebSettings` will throw an `https://developer.android.com/reference/java/lang/IllegalStateException`.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_AUTO` *This constant was deprecated in API level 33. refer to `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`* |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_OFF` *This constant was deprecated in API level 33. refer to `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`* |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_ON` *This constant was deprecated in API level 33. refer to `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`* |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_CACHE_ELSE_NETWORK` Use cached resources when they are available, even if they have expired. |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_CACHE_ONLY` Don't use the network, load from the cache. |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_DEFAULT` Default cache usage mode. |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_NORMAL` *This constant was deprecated in API level 17. This value is obsolete, as from API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#HONEYCOMB` and onwards it has the same effect as `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_DEFAULT`.* |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_NO_CACHE` Don't use the cache, load from the network. |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_NONE` No menu items should be disabled. |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_PROCESS_TEXT` Disable all the action mode menu items for text processing. |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_SHARE` Disable menu item "Share". |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_WEB_SEARCH` Disable menu item "Web Search". |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_ALWAYS_ALLOW` In this mode, the WebView will allow a secure origin to load content from any other origin, even if that origin is insecure. |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_COMPATIBILITY_MODE` In this mode, the WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content. |
| `int` | `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_NEVER_ALLOW` In this mode, the WebView will not allow a secure origin to load content from an insecure origin. |

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

| ### Public methods ||
|---|---|
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#enableSmoothTransition()() ` *This method was deprecated in API level 17. This method is now obsolete, and will become a no-op in future.* |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getAllowContentAccess()() ` Gets whether this WebView supports content URL access. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getAllowFileAccess()() ` Gets whether this WebView supports file access. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getAllowFileAccessFromFileURLs()() ` Gets whether JavaScript running in the context of a file scheme URL can access content from other file scheme URLs. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getAllowUniversalAccessFromFileURLs()() ` Gets whether JavaScript running in the context of a file scheme URL can access content from any origin. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getBlockNetworkImage()() ` Gets whether the WebView does not load image resources from the network. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getBlockNetworkLoads()() ` Gets whether the WebView does not load any resources from the network. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getBuiltInZoomControls()() ` Gets whether the zoom mechanisms built into WebView are being used. |
| ` abstract int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getCacheMode()() ` Gets the current setting for overriding the cache mode. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getCursiveFontFamily()() ` Gets the cursive font family name. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDatabaseEnabled()() ` *This method was deprecated in API level 35. WebSQL is deprecated and this method will become a no-op on all Android versions once support is removed in Chromium. See https://developer.chrome.com/blog/deprecating-web-sql for more information.* |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDatabasePath()() ` *This method was deprecated in API level 19. Database paths are managed by the implementation this method is obsolete.* |
| ` abstract int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDefaultFixedFontSize()() ` Gets the default fixed font size. |
| ` abstract int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDefaultFontSize()() ` Gets the default font size. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDefaultTextEncodingName()() ` Gets the default text encoding name. |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDefaultUserAgent(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` Returns the default User-Agent used by a WebView. |
| ` abstract https://developer.android.com/reference/android/webkit/WebSettings.ZoomDensity` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDefaultZoom()() ` *This method was deprecated in API level 19. Will only return the default value.* |
| ` abstract int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDisabledActionModeMenuItems()() ` Gets the action mode menu items that are disabled, expressed in an integer field flag. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDisplayZoomControls()() ` Gets whether the WebView displays on-screen zoom controls when using the built-in zoom mechanisms. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getDomStorageEnabled()() ` Gets whether the DOM Storage APIs are enabled. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getFantasyFontFamily()() ` Gets the fantasy font family name. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getFixedFontFamily()() ` Gets the fixed font family name. |
| ` int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getForceDark()() ` *This method was deprecated in API level 33. refer to `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`.* |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getJavaScriptCanOpenWindowsAutomatically()() ` Gets whether JavaScript can open windows without a user gesture. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getJavaScriptEnabled()() ` Gets whether JavaScript is enabled. |
| ` abstract https://developer.android.com/reference/android/webkit/WebSettings.LayoutAlgorithm` | ` https://developer.android.com/reference/android/webkit/WebSettings#getLayoutAlgorithm()() ` Gets the current layout algorithm. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getLightTouchEnabled()() ` *This method was deprecated in API level 18. This setting is obsolete.* |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getLoadWithOverviewMode()() ` Gets whether this WebView loads pages in overview mode. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getLoadsImagesAutomatically()() ` Gets whether the WebView loads image resources. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getMediaPlaybackRequiresUserGesture()() ` Gets whether the WebView requires a user gesture to play media. |
| ` abstract int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getMinimumFontSize()() ` Gets the minimum font size. |
| ` abstract int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getMinimumLogicalFontSize()() ` Gets the minimum logical font size. |
| ` abstract int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getMixedContentMode()() ` Gets the current behavior of the WebView with regard to loading insecure content from a secure origin. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getOffscreenPreRaster()() ` Gets whether this WebView should raster tiles when it is offscreen but attached to a window. |
| ` abstract https://developer.android.com/reference/android/webkit/WebSettings.PluginState` | ` https://developer.android.com/reference/android/webkit/WebSettings#getPluginState()() ` *This method was deprecated in API level 18. Plugins are not supported in API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT` or later; enabling plugins is a no-op.* |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getSafeBrowsingEnabled()() ` Gets whether Safe Browsing is enabled. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getSansSerifFontFamily()() ` Gets the sans-serif font family name. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getSaveFormData()() ` *This method was deprecated in API level 26. In Android O and afterwards, this function does not have any effect. Form data will be filled from the platform's autofill service if applicable.* |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getSavePassword()() ` *This method was deprecated in API level 18. Saving passwords in WebView will not be supported in future versions.* |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getSerifFontFamily()() ` Gets the serif font family name. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getStandardFontFamily()() ` Gets the standard font family name. |
| ` https://developer.android.com/reference/android/webkit/WebSettings.TextSize` | ` https://developer.android.com/reference/android/webkit/WebSettings#getTextSize()() ` *This method was deprecated in API level 15. Use `https://developer.android.com/reference/android/webkit/WebSettings#getTextZoom()` instead.* |
| ` abstract int` | ` https://developer.android.com/reference/android/webkit/WebSettings#getTextZoom()() ` Gets the text zoom of the page in percent. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#getUseWideViewPort()() ` Gets whether the WebView supports the "viewport" HTML meta tag or will use a wide viewport. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/webkit/WebSettings#getUserAgentString()() ` Gets the WebView's user-agent string. |
| ` boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#isAlgorithmicDarkeningAllowed()() ` Get if algorithmic darkening is allowed or not for this WebView. |
| ` void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setAlgorithmicDarkeningAllowed(boolean)(boolean allow) ` Control whether algorithmic darkening is allowed. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setAllowContentAccess(boolean)(boolean allow) ` Enables or disables content URL access within WebView. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccess(boolean)(boolean allow) ` Enables or disables file access within WebView. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccessFromFileURLs(boolean)(boolean flag) ` *This method was deprecated in API level 30. This setting is not secure, please use [androidx.webkit.WebViewAssetLoader](https://developer.android.com/reference/androidx/webkit/WebViewAssetLoader) to load file content securely.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setAllowUniversalAccessFromFileURLs(boolean)(boolean flag) ` *This method was deprecated in API level 30. This setting is not secure, please use [androidx.webkit.WebViewAssetLoader](https://developer.android.com/reference/androidx/webkit/WebViewAssetLoader) to load file content securely.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setBlockNetworkImage(boolean)(boolean flag) ` Sets whether the WebView should not load image resources from the network (resources accessed via http and https URI schemes). |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setBlockNetworkLoads(boolean)(boolean flag) ` Sets whether the WebView should not load resources from the network. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setBuiltInZoomControls(boolean)(boolean enabled) ` Sets whether the WebView should use its built-in zoom mechanisms. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setCacheMode(int)(int mode) ` Overrides the way the cache is used. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setCursiveFontFamily(java.lang.String)(https://developer.android.com/reference/java/lang/String font) ` Sets the cursive font family name. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDatabaseEnabled(boolean)(boolean flag) ` *This method was deprecated in API level 35. WebSQL is deprecated and this method will become a no-op on all Android versions once support is removed in Chromium. See https://developer.chrome.com/blog/deprecating-web-sql for more information.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDatabasePath(java.lang.String)(https://developer.android.com/reference/java/lang/String databasePath) ` *This method was deprecated in API level 19. Database paths are managed by the implementation and calling this method will have no effect.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDefaultFixedFontSize(int)(int size) ` Sets the default fixed font size. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDefaultFontSize(int)(int size) ` Sets the default font size. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDefaultTextEncodingName(java.lang.String)(https://developer.android.com/reference/java/lang/String encoding) ` Sets the default text encoding name to use when decoding html pages. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDefaultZoom(android.webkit.WebSettings.ZoomDensity)(https://developer.android.com/reference/android/webkit/WebSettings.ZoomDensity zoom) ` *This method was deprecated in API level 19. This method is no longer supported, see the function documentation for recommended alternatives.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDisabledActionModeMenuItems(int)(int menuItems) ` Disables the action mode menu items according to `menuItems` flag. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDisplayZoomControls(boolean)(boolean enabled) ` Sets whether the WebView should display on-screen zoom controls when using the built-in zoom mechanisms. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setDomStorageEnabled(boolean)(boolean flag) ` Sets whether the DOM storage API is enabled. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setEnableSmoothTransition(boolean)(boolean enable) ` *This method was deprecated in API level 17. This method is now obsolete, and will become a no-op in future.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setFantasyFontFamily(java.lang.String)(https://developer.android.com/reference/java/lang/String font) ` Sets the fantasy font family name. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setFixedFontFamily(java.lang.String)(https://developer.android.com/reference/java/lang/String font) ` Sets the fixed font family name. |
| ` void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)(int forceDark) ` *This method was deprecated in API level 33. The "force dark" model previously implemented by WebView was complex and didn't interoperate well with current Web standards for `prefers-color-scheme` and `color-scheme`. In apps with `targetSdkVersion` ≥ `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU` this API is a no-op and WebView will always use the dark style defined by web content authors if the app's theme is dark. To customize the behavior, refer to `https://developer.android.com/reference/android/webkit/WebSettings#setAlgorithmicDarkeningAllowed(boolean)`.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setGeolocationDatabasePath(java.lang.String)(https://developer.android.com/reference/java/lang/String databasePath) ` *This method was deprecated in API level 24. Geolocation database are managed by the implementation and calling this method will have no effect.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setGeolocationEnabled(boolean)(boolean flag) ` Sets whether Geolocation is enabled. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setJavaScriptCanOpenWindowsAutomatically(boolean)(boolean flag) ` Allows JavaScript to open windows without a user gesture. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setJavaScriptEnabled(boolean)(boolean flag) ` Tells the WebView to enable JavaScript execution. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setLayoutAlgorithm(android.webkit.WebSettings.LayoutAlgorithm)(https://developer.android.com/reference/android/webkit/WebSettings.LayoutAlgorithm l) ` Sets the underlying layout algorithm. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setLightTouchEnabled(boolean)(boolean enabled) ` *This method was deprecated in API level 18. From `https://developer.android.com/reference/android/os/Build.VERSION_CODES#JELLY_BEAN` this setting is obsolete and has no effect.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setLoadWithOverviewMode(boolean)(boolean overview) ` Sets whether the WebView loads pages in overview mode, that is, zooms out the content to fit on screen by width. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setLoadsImagesAutomatically(boolean)(boolean flag) ` Sets whether the WebView should load image resources. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setMediaPlaybackRequiresUserGesture(boolean)(boolean require) ` Sets whether the WebView requires a user gesture to play media. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setMinimumFontSize(int)(int size) ` Sets the minimum font size. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setMinimumLogicalFontSize(int)(int size) ` Sets the minimum logical font size. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setMixedContentMode(int)(int mode) ` Configures the WebView's behavior when a secure origin attempts to load a resource from an insecure origin. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setNeedInitialFocus(boolean)(boolean flag) ` Tells the WebView whether it needs to set a node to have focus when `https://developer.android.com/reference/android/webkit/WebView#requestFocus(int,%20android.graphics.Rect)` is called. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setOffscreenPreRaster(boolean)(boolean enabled) ` Sets whether this WebView should raster tiles when it is offscreen but attached to a window. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setPluginState(android.webkit.WebSettings.PluginState)(https://developer.android.com/reference/android/webkit/WebSettings.PluginState state) ` *This method was deprecated in API level 18. Plugins are not supported in API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT` or later; enabling plugins is a no-op.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setRenderPriority(android.webkit.WebSettings.RenderPriority)(https://developer.android.com/reference/android/webkit/WebSettings.RenderPriority priority) ` *This method was deprecated in API level 18. This is no longer supported. See `https://developer.android.com/reference/android/webkit/WebView#setRendererPriorityPolicy(int,%20boolean)` if you instead want to control how freely the system should kill the renderer process under low memory conditions.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setSafeBrowsingEnabled(boolean)(boolean enabled) ` Sets whether Safe Browsing is enabled. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setSansSerifFontFamily(java.lang.String)(https://developer.android.com/reference/java/lang/String font) ` Sets the sans-serif font family name. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setSaveFormData(boolean)(boolean save) ` *This method was deprecated in API level 26. In Android O and afterwards, this function does not have any effect. Form data will be saved to platform's autofill service if applicable.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setSavePassword(boolean)(boolean save) ` *This method was deprecated in API level 18. Saving passwords in WebView will not be supported in future versions.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setSerifFontFamily(java.lang.String)(https://developer.android.com/reference/java/lang/String font) ` Sets the serif font family name. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setStandardFontFamily(java.lang.String)(https://developer.android.com/reference/java/lang/String font) ` Sets the standard font family name. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setSupportMultipleWindows(boolean)(boolean support) ` Sets whether the WebView should support multiple windows. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setSupportZoom(boolean)(boolean support) ` Sets whether the WebView should support zooming using its on-screen zoom controls and gestures. |
| ` void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setTextSize(android.webkit.WebSettings.TextSize)(https://developer.android.com/reference/android/webkit/WebSettings.TextSize t) ` *This method was deprecated in API level 15. Use `https://developer.android.com/reference/android/webkit/WebSettings#setTextZoom(int)` instead.* |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setTextZoom(int)(int textZoom) ` Sets the text zoom of the page in percent. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setUseWideViewPort(boolean)(boolean use) ` Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. |
| ` abstract void` | ` https://developer.android.com/reference/android/webkit/WebSettings#setUserAgentString(java.lang.String)(https://developer.android.com/reference/java/lang/String ua) ` Sets the WebView's user-agent string. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#supportMultipleWindows()() ` Gets whether the WebView supports multiple windows. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/webkit/WebSettings#supportZoom()() ` Gets whether the WebView supports zoom. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` 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 https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` 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` ` 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` ` 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*.

## Constants

### FORCE_DARK_AUTO

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

```
public static final int FORCE_DARK_AUTO
```

<br />

**This constant was deprecated in API level 33.**   

refer to `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`

Enable force dark dependent on the state of the WebView parent view. If the WebView parent view is being automatically force darkened (see: `https://developer.android.com/reference/android/view/View#setForceDarkAllowed(boolean)`), then WebView content will be rendered so as to emulate a dark theme. WebViews that are not attached to the view hierarchy will not be inverted.

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`

Constant Value: 1 (0x00000001)

### FORCE_DARK_OFF

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

```
public static final int FORCE_DARK_OFF
```

<br />

**This constant was deprecated in API level 33.**   

refer to `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`

Disable force dark, irrespective of the force dark mode of the WebView parent. In this mode, WebView content will always be rendered as-is, regardless of whether native views are being automatically darkened.

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`

Constant Value: 0 (0x00000000)

### FORCE_DARK_ON

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

```
public static final int FORCE_DARK_ON
```

<br />

**This constant was deprecated in API level 33.**   

refer to `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`

Unconditionally enable force dark. In this mode WebView content will always be rendered so as to emulate a dark theme.

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`

Constant Value: 2 (0x00000002)

### LOAD_CACHE_ELSE_NETWORK

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

```
public static final int LOAD_CACHE_ELSE_NETWORK
```

Use cached resources when they are available, even if they have expired. Otherwise load resources from the network. Use with `https://developer.android.com/reference/android/webkit/WebSettings#setCacheMode(int)`.

<br />

Constant Value: 1 (0x00000001)

### LOAD_CACHE_ONLY

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

```
public static final int LOAD_CACHE_ONLY
```

Don't use the network, load from the cache. Use with `https://developer.android.com/reference/android/webkit/WebSettings#setCacheMode(int)`.

<br />

Constant Value: 3 (0x00000003)

### LOAD_DEFAULT

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

```
public static final int LOAD_DEFAULT
```

Default cache usage mode. If the navigation type doesn't impose any specific behavior, use cached resources when they are available and not expired, otherwise load resources from the network. Use with `https://developer.android.com/reference/android/webkit/WebSettings#setCacheMode(int)`.

<br />

Constant Value: -1 (0xffffffff)

### LOAD_NORMAL

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

```
public static final int LOAD_NORMAL
```

<br />

**This constant was deprecated in API level 17.**   

This value is obsolete, as from API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#HONEYCOMB` and onwards it has the same effect as `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_DEFAULT`.

Normal cache usage mode. Use with `https://developer.android.com/reference/android/webkit/WebSettings#setCacheMode(int)`.

<br />

Constant Value: 0 (0x00000000)

### LOAD_NO_CACHE

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

```
public static final int LOAD_NO_CACHE
```

Don't use the cache, load from the network. Use with `https://developer.android.com/reference/android/webkit/WebSettings#setCacheMode(int)`.

<br />

Constant Value: 2 (0x00000002)

### MENU_ITEM_NONE

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

```
public static final int MENU_ITEM_NONE
```

No menu items should be disabled.

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDisabledActionModeMenuItems(int)`

Constant Value: 0 (0x00000000)

### MENU_ITEM_PROCESS_TEXT

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

```
public static final int MENU_ITEM_PROCESS_TEXT
```

Disable all the action mode menu items for text processing. By default WebView searches for activities that are able to handle `https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT` and show them in the action mode menu. If this flag is set via `https://developer.android.com/reference/android/webkit/WebSettings#setDisabledActionModeMenuItems(int)`, these menu items will be disabled.

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDisabledActionModeMenuItems(int)`

Constant Value: 4 (0x00000004)

### MENU_ITEM_SHARE

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

```
public static final int MENU_ITEM_SHARE
```

Disable menu item "Share".

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDisabledActionModeMenuItems(int)`

Constant Value: 1 (0x00000001)

### MENU_ITEM_WEB_SEARCH

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

```
public static final int MENU_ITEM_WEB_SEARCH
```

Disable menu item "Web Search".

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDisabledActionModeMenuItems(int)`

Constant Value: 2 (0x00000002)

### MIXED_CONTENT_ALWAYS_ALLOW

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

```
public static final int MIXED_CONTENT_ALWAYS_ALLOW
```

In this mode, the WebView will allow a secure origin to load content from any other origin, even if that origin is insecure. This is the least secure mode of operation for the WebView, and where possible apps should not set this mode.

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setMixedContentMode(int)`

Constant Value: 0 (0x00000000)

### MIXED_CONTENT_COMPATIBILITY_MODE

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

```
public static final int MIXED_CONTENT_COMPATIBILITY_MODE
```

In this mode, the WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content. Some insecure content may be allowed to be loaded by a secure origin and other types of content will be blocked. The types of content are allowed or blocked may change release to release and are not explicitly defined. This mode is intended to be used by apps that are not in control of the content that they render but desire to operate in a reasonably secure environment. For highest security, apps are recommended to use `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_NEVER_ALLOW`.

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setMixedContentMode(int)`

Constant Value: 2 (0x00000002)

### MIXED_CONTENT_NEVER_ALLOW

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

```
public static final int MIXED_CONTENT_NEVER_ALLOW
```

In this mode, the WebView will not allow a secure origin to load content from an insecure origin. This is the preferred and most secure mode of operation for the WebView and apps are strongly advised to use this mode.

<br />

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setMixedContentMode(int)`

Constant Value: 1 (0x00000001)

## Public constructors

### WebSettings

```
public WebSettings ()
```

<br />

<br />

## Public methods

### enableSmoothTransition

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

```
public abstract boolean enableSmoothTransition ()
```

<br />

**This method was deprecated in API level 17.**   

This method is now obsolete, and will become a no-op in future.

Gets whether the WebView enables smooth transition while panning or zooming.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setEnableSmoothTransition(boolean)`

### getAllowContentAccess

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

```
public abstract boolean getAllowContentAccess ()
```

Gets whether this WebView supports content URL access.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setAllowContentAccess(boolean)`

### getAllowFileAccess

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

```
public abstract boolean getAllowFileAccess ()
```

Gets whether this WebView supports file access.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccess(boolean)`

### getAllowFileAccessFromFileURLs

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

```
public abstract boolean getAllowFileAccessFromFileURLs ()
```

Gets whether JavaScript running in the context of a file scheme URL can access content from other file scheme URLs.

<br />

| Returns ||
|---|---|
| `boolean` | whether JavaScript running in the context of a file scheme URL can access content from other file scheme URLs <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccessFromFileURLs(boolean)`

### getAllowUniversalAccessFromFileURLs

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

```
public abstract boolean getAllowUniversalAccessFromFileURLs ()
```

Gets whether JavaScript running in the context of a file scheme URL can access content from any origin. This includes access to content from other file scheme URLs.

<br />

| Returns ||
|---|---|
| `boolean` | whether JavaScript running in the context of a file scheme URL can access content from any origin <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setAllowUniversalAccessFromFileURLs(boolean)`

### getBlockNetworkImage

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

```
public abstract boolean getBlockNetworkImage ()
```

Gets whether the WebView does not load image resources from the network.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the WebView does not load image resources from the network <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setBlockNetworkImage(boolean)`

### getBlockNetworkLoads

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

```
public abstract boolean getBlockNetworkLoads ()
```

Gets whether the WebView does not load any resources from the network.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the WebView does not load any resources from the network <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setBlockNetworkLoads(boolean)`

### getBuiltInZoomControls

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

```
public abstract boolean getBuiltInZoomControls ()
```

Gets whether the zoom mechanisms built into WebView are being used.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the zoom mechanisms built into WebView are being used <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setBuiltInZoomControls(boolean)`

### getCacheMode

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

```
public abstract int getCacheMode ()
```

Gets the current setting for overriding the cache mode.

<br />

| Returns ||
|---|---|
| `int` | the current setting for overriding the cache mode. Value is one of the following: - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_DEFAULT` - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_NORMAL` - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_CACHE_ELSE_NETWORK` - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_NO_CACHE` - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_CACHE_ONLY` |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setCacheMode(int)`

### getCursiveFontFamily

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

```
public abstract String getCursiveFontFamily ()
```

Gets the cursive font family name.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the cursive font family name as a string <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setCursiveFontFamily(java.lang.String)`

### getDatabaseEnabled

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

```
public abstract boolean getDatabaseEnabled ()
```

<br />

**This method was deprecated in API level 35.**   

WebSQL is deprecated and this method will become a no-op on all Android versions once support is removed in Chromium. See https://developer.chrome.com/blog/deprecating-web-sql for more information.

Gets whether the database storage API is enabled.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the database storage API is enabled <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDatabaseEnabled(boolean)`

### getDatabasePath

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

```
public abstract String getDatabasePath ()
```

<br />

**This method was deprecated in API level 19.**   

Database paths are managed by the implementation this method is obsolete.

Gets the path to where database storage API databases are saved.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the String path to the database storage API databases <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDatabasePath(java.lang.String)`

### getDefaultFixedFontSize

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

```
public abstract int getDefaultFixedFontSize ()
```

Gets the default fixed font size.

<br />

| Returns ||
|---|---|
| `int` | a non-negative integer between 1 and 72 <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDefaultFixedFontSize(int)`

### getDefaultFontSize

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

```
public abstract int getDefaultFontSize ()
```

Gets the default font size.

<br />

| Returns ||
|---|---|
| `int` | a non-negative integer between 1 and 72 <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDefaultFontSize(int)`

### getDefaultTextEncodingName

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

```
public abstract String getDefaultTextEncodingName ()
```

Gets the default text encoding name.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the default text encoding name as a string <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDefaultTextEncodingName(java.lang.String)`

### getDefaultUserAgent

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

```
public static String getDefaultUserAgent (Context context)
```

Returns the default User-Agent used by a WebView. An instance of WebView could use a different User-Agent if a call is made to `https://developer.android.com/reference/android/webkit/WebSettings#setUserAgentString(java.lang.String)`.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: a Context object used to access application assets <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getDefaultZoom

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

```
public abstract WebSettings.ZoomDensity getDefaultZoom ()
```

<br />

**This method was deprecated in API level 19.**   

Will only return the default value.

Gets the default zoom density of the page. This should be called from the UI thread. This setting is not recommended for use in new applications.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/webkit/WebSettings.ZoomDensity` | the zoom density <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDefaultZoom(android.webkit.WebSettings.ZoomDensity)`

### getDisabledActionModeMenuItems

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

```
public abstract int getDisabledActionModeMenuItems ()
```

Gets the action mode menu items that are disabled, expressed in an integer field flag. The default value is `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_NONE`

<br />

| Returns ||
|---|---|
| `int` | all the disabled menu item flags combined with bitwise OR. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_NONE` - `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_SHARE` - `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_WEB_SEARCH` - `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_PROCESS_TEXT` |

### getDisplayZoomControls

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

```
public abstract boolean getDisplayZoomControls ()
```

Gets whether the WebView displays on-screen zoom controls when using the built-in zoom mechanisms.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the WebView displays on-screen zoom controls when using the built-in zoom mechanisms <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDisplayZoomControls(boolean)`

### getDomStorageEnabled

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

```
public abstract boolean getDomStorageEnabled ()
```

Gets whether the DOM Storage APIs are enabled.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the DOM Storage APIs are enabled <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setDomStorageEnabled(boolean)`

### getFantasyFontFamily

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

```
public abstract String getFantasyFontFamily ()
```

Gets the fantasy font family name.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the fantasy font family name as a string <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setFantasyFontFamily(java.lang.String)`

### getFixedFontFamily

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

```
public abstract String getFixedFontFamily ()
```

Gets the fixed font family name.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the fixed font family name as a string <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setFixedFontFamily(java.lang.String)`

### getForceDark

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

```
public int getForceDark ()
```

<br />

**This method was deprecated in API level 33.**   

refer to `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`.

Get the force dark mode for this WebView. The default force dark mode is `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_AUTO`.

<br />

| Returns ||
|---|---|
| `int` | the currently set force dark mode. Value is one of the following: - `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_OFF` - `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_AUTO` - `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_ON` |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)`

### getJavaScriptCanOpenWindowsAutomatically

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

```
public abstract boolean getJavaScriptCanOpenWindowsAutomatically ()
```

Gets whether JavaScript can open windows without a user gesture.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if JavaScript can open windows without a user gesture using `window.open()` <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setJavaScriptCanOpenWindowsAutomatically(boolean)`

### getJavaScriptEnabled

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

```
public abstract boolean getJavaScriptEnabled ()
```

Gets whether JavaScript is enabled.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if JavaScript is enabled <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setJavaScriptEnabled(boolean)`

### getLayoutAlgorithm

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

```
public abstract WebSettings.LayoutAlgorithm getLayoutAlgorithm ()
```

Gets the current layout algorithm.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/webkit/WebSettings.LayoutAlgorithm` | the layout algorithm in use, as a `https://developer.android.com/reference/android/webkit/WebSettings.LayoutAlgorithm` value <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setLayoutAlgorithm(android.webkit.WebSettings.LayoutAlgorithm)`

### getLightTouchEnabled

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)

```
public abstract boolean getLightTouchEnabled ()
```

<br />

**This method was deprecated in API level 18.**   

This setting is obsolete.

Gets whether light touches are enabled.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setLightTouchEnabled(boolean)`

### getLoadWithOverviewMode

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

```
public abstract boolean getLoadWithOverviewMode ()
```

Gets whether this WebView loads pages in overview mode.

<br />

| Returns ||
|---|---|
| `boolean` | whether this WebView loads pages in overview mode <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setLoadWithOverviewMode(boolean)`

### getLoadsImagesAutomatically

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

```
public abstract boolean getLoadsImagesAutomatically ()
```

Gets whether the WebView loads image resources. This includes images embedded using the data URI scheme.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the WebView loads image resources <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setLoadsImagesAutomatically(boolean)`

### getMediaPlaybackRequiresUserGesture

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

```
public abstract boolean getMediaPlaybackRequiresUserGesture ()
```

Gets whether the WebView requires a user gesture to play media.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the WebView requires a user gesture to play media <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setMediaPlaybackRequiresUserGesture(boolean)`

### getMinimumFontSize

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

```
public abstract int getMinimumFontSize ()
```

Gets the minimum font size.

<br />

| Returns ||
|---|---|
| `int` | a non-negative integer between 1 and 72 <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setMinimumFontSize(int)`

### getMinimumLogicalFontSize

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

```
public abstract int getMinimumLogicalFontSize ()
```

Gets the minimum logical font size.

<br />

| Returns ||
|---|---|
| `int` | a non-negative integer between 1 and 72 <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setMinimumLogicalFontSize(int)`

### getMixedContentMode

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

```
public abstract int getMixedContentMode ()
```

Gets the current behavior of the WebView with regard to loading insecure content from a secure origin.

<br />

| Returns ||
|---|---|
| `int` | The current setting, one of `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_NEVER_ALLOW`, `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_ALWAYS_ALLOW` or `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_COMPATIBILITY_MODE`. <br /> |

### getOffscreenPreRaster

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

```
public abstract boolean getOffscreenPreRaster ()
```

Gets whether this WebView should raster tiles when it is offscreen but attached to a window.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if this WebView will raster tiles when it is offscreen but attached to a window. <br /> |

### getPluginState

Added in [API level 8](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)

```
public abstract WebSettings.PluginState getPluginState ()
```

<br />

**This method was deprecated in API level 18.**   

Plugins are not supported in API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT` or later; enabling plugins is a no-op.

Gets the current state regarding whether plugins are enabled.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/webkit/WebSettings.PluginState` | the plugin state as a `https://developer.android.com/reference/android/webkit/WebSettings.PluginState` value <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setPluginState(android.webkit.WebSettings.PluginState)`

### getSafeBrowsingEnabled

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

```
public abstract boolean getSafeBrowsingEnabled ()
```

Gets whether Safe Browsing is enabled. See `https://developer.android.com/reference/android/webkit/WebSettings#setSafeBrowsingEnabled(boolean)`.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if Safe Browsing is enabled and `false` otherwise. <br /> |

### getSansSerifFontFamily

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

```
public abstract String getSansSerifFontFamily ()
```

Gets the sans-serif font family name.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the sans-serif font family name as a string <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setSansSerifFontFamily(java.lang.String)`

### getSaveFormData

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

```
public abstract boolean getSaveFormData ()
```

<br />

**This method was deprecated in API level 26.**   

In Android O and afterwards, this function does not have any effect. Form data will be filled from the platform's autofill service if applicable.

Gets whether the WebView saves form data. In `https://developer.android.com/reference/android/os/Build.VERSION_CODES#O`, the platform has implemented a fully functional Autofill feature to store form data. Therefore, the Webview form data save feature is disabled.

Note that the feature will continue to be supported on older versions of Android as before.

<br />

| Returns ||
|---|---|
| `boolean` | whether the WebView saves form data <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setSaveFormData(boolean)`

### getSavePassword

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)

```
public abstract boolean getSavePassword ()
```

<br />

**This method was deprecated in API level 18.**   

Saving passwords in WebView will not be supported in future versions.

Gets whether the WebView saves passwords.

<br />

| Returns ||
|---|---|
| `boolean` | whether the WebView saves passwords <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setSavePassword(boolean)`

### getSerifFontFamily

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

```
public abstract String getSerifFontFamily ()
```

Gets the serif font family name. The default is "serif".

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the serif font family name as a string <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setSerifFontFamily(java.lang.String)`

### getStandardFontFamily

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

```
public abstract String getStandardFontFamily ()
```

Gets the standard font family name.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the standard font family name as a string <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setStandardFontFamily(java.lang.String)`

### getTextSize

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

```
public WebSettings.TextSize getTextSize ()
```

<br />

**This method was deprecated in API level 15.**   

Use `https://developer.android.com/reference/android/webkit/WebSettings#getTextZoom()` instead.

Gets the text size of the page. If the text size was previously specified in percent using `https://developer.android.com/reference/android/webkit/WebSettings#setTextZoom(int)`, this will return the closest matching `https://developer.android.com/reference/android/webkit/WebSettings.TextSize`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/webkit/WebSettings.TextSize` | the text size as a `https://developer.android.com/reference/android/webkit/WebSettings.TextSize` value <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setTextSize(android.webkit.WebSettings.TextSize)`

### getTextZoom

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

```
public abstract int getTextZoom ()
```

Gets the text zoom of the page in percent.

<br />

| Returns ||
|---|---|
| `int` | the text zoom of the page in percent <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setTextZoom(int)`

### getUseWideViewPort

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

```
public abstract boolean getUseWideViewPort ()
```

Gets whether the WebView supports the "viewport" HTML meta tag or will use a wide viewport.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the WebView supports the viewport meta tag <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setUseWideViewPort(boolean)`

### getUserAgentString

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

```
public abstract String getUserAgentString ()
```

Gets the WebView's user-agent string.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the WebView's user-agent string <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setUserAgentString(java.lang.String)`

### isAlgorithmicDarkeningAllowed

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

```
public boolean isAlgorithmicDarkeningAllowed ()
```

Get if algorithmic darkening is allowed or not for this WebView. The default is false.

<br />

| Returns ||
|---|---|
| `boolean` | if the algorithmic darkening is allowed or not. <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setAlgorithmicDarkeningAllowed(boolean)`

### setAlgorithmicDarkeningAllowed

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

```
public void setAlgorithmicDarkeningAllowed (boolean allow)
```

Control whether algorithmic darkening is allowed.

**Note:** This API and the behaviour described only apply to apps with `targetSdkVersion` ≥ `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.

WebView always sets the media query `prefers-color-scheme` according to the app's theme attribute `https://developer.android.com/reference/android/R.styleable#Theme_isLightTheme`, i.e. `prefers-color-scheme` is `light` if isLightTheme is true or not specified, otherwise it is `dark`. This means that the web content's light or dark style will be applied automatically to match the app's theme if the content supports it.

Algorithmic darkening is disallowed by default.

If the app's theme is dark and it allows algorithmic darkening, WebView will attempt to darken web content using an algorithm, if the content doesn't define its own dark styles and doesn't explicitly disable darkening.

If Android is applying Force Dark to WebView then WebView will ignore the value of this setting and behave as if it were set to true.

The deprecated `https://developer.android.com/reference/android/webkit/WebSettings#setForceDark(int)` and related API are no-ops in apps with `targetSdkVersion` ≥ `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, but they still apply to apps with `targetSdkVersion` \< `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.

The below table summarizes how APIs work with different apps.

| App | Web content which uses `prefers-color-scheme` | Web content which does not use `prefers-color-scheme` |
|---|---|---|
| App with `isLightTheme` True or not set | Renders with the light theme defined by the content author. | Renders with the default styling defined by the content author. |
| App with Android forceDark in effect | Renders with the dark theme defined by the content author. | Renders with the styling modified to dark colors by an algorithm if allowed by the content author. |
| App with `isLightTheme` False, `targetSdkVersion` \< `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, and has `FORCE_DARK_AUTO` | Renders with the dark theme defined by the content author. | Renders with the default styling defined by the content author. |
| App with `isLightTheme` False, `targetSdkVersion` ≥ `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, and `setAlgorithmicDarkening(false)` | Renders with the dark theme defined by the content author. | Renders with the default styling defined by the content author. |
| App with `isLightTheme` False, `targetSdkVersion` ≥ `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, and `setAlgorithmicDarkening(true)` | Renders with the dark theme defined by the content author. | Renders with the styling modified to dark colors by an algorithm if allowed by the content author. |

<br />

<br />

<br />

| Parameters ||
|---|---|
| `allow` | `boolean`: allow algorithmic darkening or not. <br /> |

### setAllowContentAccess

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

```
public abstract void setAllowContentAccess (boolean allow)
```

Enables or disables content URL access within WebView. Content URL access allows WebView to load content from a content provider installed in the system. The default is enabled.

<br />

| Parameters ||
|---|---|
| `allow` | `boolean` <br /> |

### setAllowFileAccess

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

```
public abstract void setAllowFileAccess (boolean allow)
```

Enables or disables file access within WebView. Note that this enables or disables file system access only. Assets and resources are still accessible using file:///android_asset and file:///android_res.

**Note:** Apps should not open `file://` URLs from any external source in WebView, don't enable this if your app accepts arbitrary URLs from external sources. It's recommended to always use [androidx.webkit.WebViewAssetLoader](https://developer.android.com/reference/androidx/webkit/WebViewAssetLoader) to access files including assets and resources over `http(s)://` schemes, instead of `file://` URLs. To prevent possible security issues targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` and earlier, you should explicitly set this value to `false`.

The default value is `true` for apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` and below, and `false` when targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` and above.

<br />

| Parameters ||
|---|---|
| `allow` | `boolean` <br /> |

### setAllowFileAccessFromFileURLs

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

```
public abstract void setAllowFileAccessFromFileURLs (boolean flag)
```

<br />

**This method was deprecated in API level 30.**   

This setting is not secure, please use [androidx.webkit.WebViewAssetLoader](https://developer.android.com/reference/androidx/webkit/WebViewAssetLoader) to load file content securely.

Sets whether cross-origin requests in the context of a file scheme URL should be allowed to access content from other file scheme URLs. Note that some accesses such as image HTML elements don't follow same-origin rules and aren't affected by this setting.

**Don't** enable this setting if you open files that may be created or altered by external sources. Enabling this setting allows malicious scripts loaded in a `file://` context to access arbitrary local files including WebView cookies and app private data.

Loading content via `file://` URLs is generally discouraged. See the note in `https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccess(boolean)`.

Note that the value of this setting is ignored if the value of `https://developer.android.com/reference/android/webkit/WebSettings#getAllowUniversalAccessFromFileURLs()` is `true`. The default value is `true` for apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1` and below, and `false` when targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#JELLY_BEAN` and above. To prevent possible violation of same domain policy when targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1` and earlier, you should explicitly set this value to `false`.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: whether JavaScript running in the context of a file scheme URL should be allowed to access content from other file scheme URLs <br /> |

### setAllowUniversalAccessFromFileURLs

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

```
public abstract void setAllowUniversalAccessFromFileURLs (boolean flag)
```

<br />

**This method was deprecated in API level 30.**   

This setting is not secure, please use [androidx.webkit.WebViewAssetLoader](https://developer.android.com/reference/androidx/webkit/WebViewAssetLoader) to load file content securely.

Sets whether cross-origin requests in the context of a file scheme URL should be allowed to access content from *any* origin. This includes access to content from other file scheme URLs or web contexts. Note that some access such as image HTML elements doesn't follow same-origin rules and isn't affected by this setting.

**Don't** enable this setting if you open files that may be created or altered by external sources. Enabling this setting allows malicious scripts loaded in a `file://` context to launch cross-site scripting attacks, either accessing arbitrary local files including WebView cookies, app private data or even credentials used on arbitrary web sites.

Loading content via `file://` URLs is generally discouraged. See the note in `https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccess(boolean)`.

The default value is `true` for apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1` and below, and `false` when targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#JELLY_BEAN` and above. To prevent possible violation of same domain policy when targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1` and earlier, you should explicitly set this value to `false`.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: whether JavaScript running in the context of a file scheme URL should be allowed to access content from any origin <br /> |

### setBlockNetworkImage

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

```
public abstract void setBlockNetworkImage (boolean flag)
```

Sets whether the WebView should not load image resources from the network (resources accessed via http and https URI schemes). Note that this method has no effect unless `https://developer.android.com/reference/android/webkit/WebSettings#getLoadsImagesAutomatically()` returns `true`. Also note that disabling all network loads using `https://developer.android.com/reference/android/webkit/WebSettings#setBlockNetworkLoads(boolean)` will also prevent network images from loading, even if this flag is set to false. When the value of this setting is changed from `true` to `false`, network images resources referenced by content currently displayed by the WebView are fetched automatically. The default is `false`.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: whether the WebView should not load image resources from the network <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setBlockNetworkLoads(boolean)`

### setBlockNetworkLoads

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

```
public abstract void setBlockNetworkLoads (boolean flag)
```

Sets whether the WebView should not load resources from the network. Use `https://developer.android.com/reference/android/webkit/WebSettings#setBlockNetworkImage(boolean)` to only avoid loading image resources. Note that if the value of this setting is changed from `true` to `false`, network resources referenced by content currently displayed by the WebView are not fetched until `https://developer.android.com/reference/android/webkit/WebView#reload()` is called. If the application does not have the `https://developer.android.com/reference/android/Manifest.permission#INTERNET` permission, attempts to set a value of `false` will cause a `https://developer.android.com/reference/java/lang/SecurityException` to be thrown. The default value is `false` if the application has the `https://developer.android.com/reference/android/Manifest.permission#INTERNET` permission, otherwise it is `true`.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: `true` means block network loads by the WebView <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebView#reload()`

### setBuiltInZoomControls

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

```
public abstract void setBuiltInZoomControls (boolean enabled)
```

Sets whether the WebView should use its built-in zoom mechanisms. The built-in zoom mechanisms comprise on-screen zoom controls, which are displayed over the WebView's content, and the use of a pinch gesture to control zooming. Whether or not these on-screen controls are displayed can be set with `https://developer.android.com/reference/android/webkit/WebSettings#setDisplayZoomControls(boolean)`. The default is `false`.

The built-in mechanisms are the only currently supported zoom mechanisms, so it is recommended that this setting is always enabled. However, on-screen zoom controls are deprecated in Android (see `https://developer.android.com/reference/android/widget/ZoomButtonsController`) so it's recommended to disable `https://developer.android.com/reference/android/webkit/WebSettings#setDisplayZoomControls(boolean)`.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: whether the WebView should use its built-in zoom mechanisms <br /> |

### setCacheMode

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

```
public abstract void setCacheMode (int mode)
```

Overrides the way the cache is used. The way the cache is used is based on the navigation type. For a normal page load, the cache is checked and content is re-validated as needed. When navigating back, content is not revalidated, instead the content is just retrieved from the cache. This method allows the client to override this behavior by specifying one of `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_DEFAULT`, `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_CACHE_ELSE_NETWORK`, `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_NO_CACHE` or `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_CACHE_ONLY`. The default value is `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_DEFAULT`.

<br />

| Parameters ||
|---|---|
| `mode` | `int`: the mode to use. Value is one of the following: - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_DEFAULT` - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_NORMAL` - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_CACHE_ELSE_NETWORK` - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_NO_CACHE` - `https://developer.android.com/reference/android/webkit/WebSettings#LOAD_CACHE_ONLY` |

### setCursiveFontFamily

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

```
public abstract void setCursiveFontFamily (String font)
```

Sets the cursive font family name. The default is "cursive".

<br />

| Parameters ||
|---|---|
| `font` | `String`: a font family name <br /> |

### setDatabaseEnabled

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

```
public abstract void setDatabaseEnabled (boolean flag)
```

<br />

**This method was deprecated in API level 35.**   

WebSQL is deprecated and this method will become a no-op on all Android versions once support is removed in Chromium. See https://developer.chrome.com/blog/deprecating-web-sql for more information.

Sets whether the database storage API is enabled. The default value is false. See also `https://developer.android.com/reference/android/webkit/WebSettings#setDatabasePath(java.lang.String)` for how to correctly set up the database storage API. This setting is global in effect, across all WebView instances in a process. Note you should only modify this setting prior to making **any** WebView page load within a given process, as the WebView implementation may ignore changes to this setting after that point.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: `true` if the WebView should use the database storage API <br /> |

### setDatabasePath

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

```
public abstract void setDatabasePath (String databasePath)
```

<br />

**This method was deprecated in API level 19.**   

Database paths are managed by the implementation and calling this method will have no effect.

Sets the path to where database storage API databases should be saved. In order for the database storage API to function correctly, this method must be called with a path to which the application can write. This method should only be called once: repeated calls are ignored.

<br />

| Parameters ||
|---|---|
| `databasePath` | `String`: a path to the directory where databases should be saved. <br /> |

### setDefaultFixedFontSize

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

```
public abstract void setDefaultFixedFontSize (int size)
```

Sets the default fixed font size. The default is 16.

<br />

| Parameters ||
|---|---|
| `size` | `int`: a non-negative integer between 1 and 72. Any number outside the specified range will be pinned. <br /> |

### setDefaultFontSize

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

```
public abstract void setDefaultFontSize (int size)
```

Sets the default font size. The default is 16.

<br />

| Parameters ||
|---|---|
| `size` | `int`: a non-negative integer between 1 and 72. Any number outside the specified range will be pinned. <br /> |

### setDefaultTextEncodingName

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

```
public abstract void setDefaultTextEncodingName (String encoding)
```

Sets the default text encoding name to use when decoding html pages. The default is "UTF-8".

<br />

| Parameters ||
|---|---|
| `encoding` | `String`: the text encoding name <br /> |

### setDefaultZoom

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

```
public abstract void setDefaultZoom (WebSettings.ZoomDensity zoom)
```

<br />

**This method was deprecated in API level 19.**   

This method is no longer supported, see the function documentation for recommended alternatives.

Sets the default zoom density of the page. This must be called from the UI thread. The default is `https://developer.android.com/reference/android/webkit/WebSettings.ZoomDensity#MEDIUM`. This setting is not recommended for use in new applications. If the WebView is utilized to display mobile-oriented pages, the desired effect can be achieved by adjusting 'width' and 'initial-scale' attributes of page's 'meta viewport' tag. For pages lacking the tag, `https://developer.android.com/reference/android/webkit/WebView#setInitialScale(int)` and `https://developer.android.com/reference/android/webkit/WebSettings#setUseWideViewPort(boolean)` can be used.

<br />

| Parameters ||
|---|---|
| `zoom` | `WebSettings.ZoomDensity`: the zoom density <br /> |

### setDisabledActionModeMenuItems

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

```
public abstract void setDisabledActionModeMenuItems (int menuItems)
```

Disables the action mode menu items according to `menuItems` flag.

<br />

| Parameters ||
|---|---|
| `menuItems` | `int`: an integer field flag for the menu items to be disabled. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_NONE` - `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_SHARE` - `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_WEB_SEARCH` - `https://developer.android.com/reference/android/webkit/WebSettings#MENU_ITEM_PROCESS_TEXT` |

### setDisplayZoomControls

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

```
public abstract void setDisplayZoomControls (boolean enabled)
```

Sets whether the WebView should display on-screen zoom controls when using the built-in zoom mechanisms. See `https://developer.android.com/reference/android/webkit/WebSettings#setBuiltInZoomControls(boolean)`. The default is `true`. However, on-screen zoom controls are deprecated in Android (see `https://developer.android.com/reference/android/widget/ZoomButtonsController`) so it's recommended to set this to `false`.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: whether the WebView should display on-screen zoom controls <br /> |

### setDomStorageEnabled

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

```
public abstract void setDomStorageEnabled (boolean flag)
```

Sets whether the DOM storage API is enabled. The default value is `false`.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: `true` if the WebView should use the DOM storage API <br /> |

### setEnableSmoothTransition

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

```
public abstract void setEnableSmoothTransition (boolean enable)
```

<br />

**This method was deprecated in API level 17.**   

This method is now obsolete, and will become a no-op in future.

Sets whether the WebView will enable smooth transition while panning or zooming or while the window hosting the WebView does not have focus. If it is `true`, WebView will choose a solution to maximize the performance. e.g. the WebView's content may not be updated during the transition. If it is false, WebView will keep its fidelity. The default value is `false`.

<br />

| Parameters ||
|---|---|
| `enable` | `boolean` <br /> |

### setFantasyFontFamily

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

```
public abstract void setFantasyFontFamily (String font)
```

Sets the fantasy font family name. The default is "fantasy".

<br />

| Parameters ||
|---|---|
| `font` | `String`: a font family name <br /> |

### setFixedFontFamily

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

```
public abstract void setFixedFontFamily (String font)
```

Sets the fixed font family name. The default is "monospace".

<br />

| Parameters ||
|---|---|
| `font` | `String`: a font family name <br /> |

### setForceDark

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

```
public void setForceDark (int forceDark)
```

<br />

**This method was deprecated in API level 33.**   

The "force dark" model previously implemented by WebView was complex and didn't interoperate well with current Web standards for `prefers-color-scheme` and `color-scheme`. In apps with `targetSdkVersion` ≥ `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU` this API is a no-op and WebView will always use the dark style defined by web content authors if the app's theme is dark. To customize the behavior, refer to `https://developer.android.com/reference/android/webkit/WebSettings#setAlgorithmicDarkeningAllowed(boolean)`.

Set the force dark mode for this WebView.

<br />

| Parameters ||
|---|---|
| `forceDark` | `int`: the force dark mode to set. Value is one of the following: - `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_OFF` - `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_AUTO` - `https://developer.android.com/reference/android/webkit/WebSettings#FORCE_DARK_ON` |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#getForceDark()`

### setGeolocationDatabasePath

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

```
public abstract void setGeolocationDatabasePath (String databasePath)
```

<br />

**This method was deprecated in API level 24.**   

Geolocation database are managed by the implementation and calling this method will have no effect.

Sets the path where the Geolocation databases should be saved. In order for Geolocation permissions and cached positions to be persisted, this method must be called with a path to which the application can write.

<br />

| Parameters ||
|---|---|
| `databasePath` | `String`: a path to the directory where databases should be saved. <br /> |

### setGeolocationEnabled

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

```
public abstract void setGeolocationEnabled (boolean flag)
```

Sets whether Geolocation is enabled. The default is `true`.

Please note that in order for the Geolocation API to be usable by a page in the WebView, the following requirements must be met:

- an application must have permission to access the device location, see `https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION`, `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION`;
- an application must provide an implementation of the `https://developer.android.com/reference/android/webkit/WebChromeClient#onGeolocationPermissionsShowPrompt(java.lang.String,%20android.webkit.GeolocationPermissions.Callback)` callback to receive notifications that a page is requesting access to location via the JavaScript Geolocation API.

<br />

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: whether Geolocation should be enabled <br /> |

### setJavaScriptCanOpenWindowsAutomatically

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

```
public abstract void setJavaScriptCanOpenWindowsAutomatically (boolean flag)
```

Allows JavaScript to open windows without a user gesture. This applies to the JavaScript function `window.open()`. The default is `false`: attempts without a user gesture will fail and do nothing.

This is not affected by the `https://developer.android.com/reference/android/webkit/WebSettings#setSupportMultipleWindows(boolean)` setting; the user gesture requirement is enforced even if multiple windows are disabled.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: `true` if JavaScript can open windows without a user gesture. <br /> |

### setJavaScriptEnabled

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

```
public abstract void setJavaScriptEnabled (boolean flag)
```

Tells the WebView to enable JavaScript execution. **The default is `false`.**

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: `true` if the WebView should execute JavaScript <br /> |

### setLayoutAlgorithm

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

```
public abstract void setLayoutAlgorithm (WebSettings.LayoutAlgorithm l)
```

Sets the underlying layout algorithm. This will cause a re-layout of the WebView. The default is `https://developer.android.com/reference/android/webkit/WebSettings.LayoutAlgorithm#NARROW_COLUMNS`.

<br />

| Parameters ||
|---|---|
| `l` | `WebSettings.LayoutAlgorithm`: the layout algorithm to use, as a `https://developer.android.com/reference/android/webkit/WebSettings.LayoutAlgorithm` value <br /> |

### setLightTouchEnabled

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)

```
public abstract void setLightTouchEnabled (boolean enabled)
```

<br />

**This method was deprecated in API level 18.**   

From `https://developer.android.com/reference/android/os/Build.VERSION_CODES#JELLY_BEAN` this setting is obsolete and has no effect.

Enables using light touches to make a selection and activate mouseovers.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean` <br /> |

### setLoadWithOverviewMode

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

```
public abstract void setLoadWithOverviewMode (boolean overview)
```

Sets whether the WebView loads pages in overview mode, that is, zooms out the content to fit on screen by width. This setting is taken into account when the content width is greater than the width of the WebView control, for example, when `https://developer.android.com/reference/android/webkit/WebSettings#getUseWideViewPort()` is enabled. The default is `false`.

<br />

| Parameters ||
|---|---|
| `overview` | `boolean` <br /> |

### setLoadsImagesAutomatically

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

```
public abstract void setLoadsImagesAutomatically (boolean flag)
```

Sets whether the WebView should load image resources. Note that this method controls loading of all images, including those embedded using the data URI scheme. Use `https://developer.android.com/reference/android/webkit/WebSettings#setBlockNetworkImage(boolean)` to control loading only of images specified using network URI schemes. Note that if the value of this setting is changed from `false` to `true`, all images resources referenced by content currently displayed by the WebView are loaded automatically. The default is `true`.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: whether the WebView should load image resources <br /> |

### setMediaPlaybackRequiresUserGesture

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

```
public abstract void setMediaPlaybackRequiresUserGesture (boolean require)
```

Sets whether the WebView requires a user gesture to play media. The default is `true`.

<br />

| Parameters ||
|---|---|
| `require` | `boolean`: whether the WebView requires a user gesture to play media <br /> |

### setMinimumFontSize

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

```
public abstract void setMinimumFontSize (int size)
```

Sets the minimum font size. The default is 8.

<br />

| Parameters ||
|---|---|
| `size` | `int`: a non-negative integer between 1 and 72. Any number outside the specified range will be pinned. <br /> |

### setMinimumLogicalFontSize

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

```
public abstract void setMinimumLogicalFontSize (int size)
```

Sets the minimum logical font size. The default is 8.

<br />

| Parameters ||
|---|---|
| `size` | `int`: a non-negative integer between 1 and 72. Any number outside the specified range will be pinned. <br /> |

### setMixedContentMode

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

```
public abstract void setMixedContentMode (int mode)
```

Configures the WebView's behavior when a secure origin attempts to load a resource from an insecure origin. By default, apps that target `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT` or below default to `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_ALWAYS_ALLOW`. Apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#LOLLIPOP` default to `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_NEVER_ALLOW`. The preferred and most secure mode of operation for the WebView is `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_NEVER_ALLOW` and use of `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_ALWAYS_ALLOW` is strongly discouraged.

<br />

| Parameters ||
|---|---|
| `mode` | `int`: The mixed content mode to use. One of `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_NEVER_ALLOW`, `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_ALWAYS_ALLOW` or `https://developer.android.com/reference/android/webkit/WebSettings#MIXED_CONTENT_COMPATIBILITY_MODE`. <br /> |

### setNeedInitialFocus

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

```
public abstract void setNeedInitialFocus (boolean flag)
```

Tells the WebView whether it needs to set a node to have focus when `https://developer.android.com/reference/android/webkit/WebView#requestFocus(int,%20android.graphics.Rect)` is called. The default value is `true`.

<br />

| Parameters ||
|---|---|
| `flag` | `boolean`: whether the WebView needs to set a node <br /> |

### setOffscreenPreRaster

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

```
public abstract void setOffscreenPreRaster (boolean enabled)
```

Sets whether this WebView should raster tiles when it is offscreen but attached to a window. Turning this on can avoid rendering artifacts when animating an offscreen WebView on-screen. Offscreen WebViews in this mode use more memory. The default value is false.  

Please follow these guidelines to limit memory usage:

- WebView size should be not be larger than the device screen size.
- Limit use of this mode to a small number of WebViews. Use it for visible WebViews and WebViews about to be animated to visible.

<br />

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean` <br /> |

### setPluginState

Added in [API level 8](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)

```
public abstract void setPluginState (WebSettings.PluginState state)
```

<br />

**This method was deprecated in API level 18.**   

Plugins are not supported in API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT` or later; enabling plugins is a no-op.

Tells the WebView to enable, disable, or have plugins on demand. On demand mode means that if a plugin exists that can handle the embedded content, a placeholder icon will be shown instead of the plugin. When the placeholder is clicked, the plugin will be enabled. The default is `https://developer.android.com/reference/android/webkit/WebSettings.PluginState#OFF`.

<br />

| Parameters ||
|---|---|
| `state` | `WebSettings.PluginState`: a PluginState value <br /> |

### setRenderPriority

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)

```
public abstract void setRenderPriority (WebSettings.RenderPriority priority)
```

<br />

**This method was deprecated in API level 18.**   

This is no longer supported. See `https://developer.android.com/reference/android/webkit/WebView#setRendererPriorityPolicy(int,%20boolean)` if you instead want to control how freely the system should kill the renderer process under low memory conditions.

Sets the CPU scheduling priority of the Render thread. Unlike the other settings, this one only needs to be called once per process. The default value is `https://developer.android.com/reference/android/webkit/WebSettings.RenderPriority#NORMAL`.

<br />

| Parameters ||
|---|---|
| `priority` | `WebSettings.RenderPriority`: the priority <br /> |

### setSafeBrowsingEnabled

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

```
public abstract void setSafeBrowsingEnabled (boolean enabled)
```

Sets whether Safe Browsing is enabled. Safe Browsing allows WebView to protect against malware and phishing attacks by verifying the links.

Safe Browsing can be disabled for all WebViews using a manifest tag (read [general Safe Browsing info](https://developer.android.com/reference/android/webkit/WebView)). The manifest tag has a lower precedence than this API.

Safe Browsing is enabled by default for devices which support it.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: Whether Safe Browsing is enabled. <br /> |

### setSansSerifFontFamily

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

```
public abstract void setSansSerifFontFamily (String font)
```

Sets the sans-serif font family name. The default is "sans-serif".

<br />

| Parameters ||
|---|---|
| `font` | `String`: a font family name <br /> |

### setSaveFormData

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

```
public abstract void setSaveFormData (boolean save)
```

<br />

**This method was deprecated in API level 26.**   

In Android O and afterwards, this function does not have any effect. Form data will be saved to platform's autofill service if applicable.

Sets whether the WebView should save form data. In `https://developer.android.com/reference/android/os/Build.VERSION_CODES#O`, the platform has implemented a fully functional Autofill feature to store form data. Therefore, the Webview form data save feature is disabled.

Note that the feature will continue to be supported on older versions of Android as before.

<br />

| Parameters ||
|---|---|
| `save` | `boolean` <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#getSaveFormData()`

### setSavePassword

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)

```
public abstract void setSavePassword (boolean save)
```

<br />

**This method was deprecated in API level 18.**   

Saving passwords in WebView will not be supported in future versions.

Sets whether the WebView should save passwords. The default is `true`.

<br />

| Parameters ||
|---|---|
| `save` | `boolean` <br /> |

### setSerifFontFamily

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

```
public abstract void setSerifFontFamily (String font)
```

Sets the serif font family name. The default is "sans-serif".

<br />

| Parameters ||
|---|---|
| `font` | `String`: a font family name <br /> |

### setStandardFontFamily

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

```
public abstract void setStandardFontFamily (String font)
```

Sets the standard font family name. The default is "sans-serif".

<br />

| Parameters ||
|---|---|
| `font` | `String`: a font family name <br /> |

### setSupportMultipleWindows

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

```
public abstract void setSupportMultipleWindows (boolean support)
```

Sets whether the WebView should support multiple windows.

If set to `true`, the `https://developer.android.com/reference/android/webkit/WebChromeClient#onCreateWindow(android.webkit.WebView,%20boolean,%20boolean,%20android.os.Message)` callback must be implemented by the application to handle the creation of new windows.

The default is `false`. When multiple window support is disabled, requests to open new windows (either from the `window.open()` JavaScript API or from links with `target="_blank"`) will instead be treated as top-level navigations, replacing the current page in the same WebView.

<br />

| Parameters ||
|---|---|
| `support` | `boolean`: whether to support multiple windows <br /> |

### setSupportZoom

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

```
public abstract void setSupportZoom (boolean support)
```

Sets whether the WebView should support zooming using its on-screen zoom controls and gestures. The particular zoom mechanisms that should be used can be set with `https://developer.android.com/reference/android/webkit/WebSettings#setBuiltInZoomControls(boolean)`. This setting does not affect zooming performed using the `https://developer.android.com/reference/android/webkit/WebView#zoomIn()` and `https://developer.android.com/reference/android/webkit/WebView#zoomOut()` methods. The default is `true`.

<br />

| Parameters ||
|---|---|
| `support` | `boolean`: whether the WebView should support zoom <br /> |

### setTextSize

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

```
public void setTextSize (WebSettings.TextSize t)
```

<br />

**This method was deprecated in API level 15.**   

Use `https://developer.android.com/reference/android/webkit/WebSettings#setTextZoom(int)` instead.

Sets the text size of the page. The default is `https://developer.android.com/reference/android/webkit/WebSettings.TextSize#NORMAL`.

<br />

| Parameters ||
|---|---|
| `t` | `WebSettings.TextSize`: the text size as a `https://developer.android.com/reference/android/webkit/WebSettings.TextSize` value <br /> |

### setTextZoom

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

```
public abstract void setTextZoom (int textZoom)
```

Sets the text zoom of the page in percent. The default is 100.

<br />

| Parameters ||
|---|---|
| `textZoom` | `int`: the text zoom in percent <br /> |

### setUseWideViewPort

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

```
public abstract void setUseWideViewPort (boolean use)
```

Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is `false`, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is `true` and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used.

<br />

| Parameters ||
|---|---|
| `use` | `boolean`: whether to enable support for the viewport meta tag <br /> |

### setUserAgentString

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

```
public abstract void setUserAgentString (String ua)
```

Sets the WebView's user-agent string. If the string is `null` or empty, the system default value will be used.

If the user-agent is overridden in this way, the values of the User-Agent Client Hints headers and `navigator.userAgentData` for this WebView could be changed.

See [androidx.webkit.WebSettingsCompat #setUserAgentMetadata(WebSettings,UserAgentMetadata)](https://developer.android.com/reference/androidx/webkit/WebSettingsCompat
#setUserAgentMetadata(WebSettings,UserAgentMetadata)) for details.

Note that starting from `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT` Android version, changing the user-agent while loading a web page causes WebView to initiate loading once again.

<br />

| Parameters ||
|---|---|
| `ua` | `String`: new user-agent string. This value may be `null`. <br /> |

### supportMultipleWindows

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

```
public abstract boolean supportMultipleWindows ()
```

Gets whether the WebView supports multiple windows.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the WebView supports multiple windows <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setSupportMultipleWindows(boolean)`

### supportZoom

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

```
public abstract boolean supportZoom ()
```

Gets whether the WebView supports zoom.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the WebView supports zoom <br /> |

**See also:**

- `https://developer.android.com/reference/android/webkit/WebSettings#setSupportZoom(boolean)`