java.lang.Object | |
↳ | android.webkit.WebSettings |
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 WebView.getSettings() is tied to the life of the WebView. If a WebView has been destroyed, any method call on WebSettings will throw an IllegalStateException.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
WebSettings.LayoutAlgorithm | Enum for controlling the layout of html. | ||||||||||
WebSettings.RenderPriority | |||||||||||
WebSettings.TextSize | Enum for specifying the text size. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | LOAD_CACHE_ELSE_NETWORK | Use cache if content is there, even if expired (eg, history nav) If it is not in the cache, load from network. | |||||||||
int | LOAD_CACHE_ONLY | Don't use the network, load from cache only. | |||||||||
int | LOAD_DEFAULT | Default cache usage pattern Use with setCacheMode(int). | |||||||||
int | LOAD_NORMAL | Normal cache usage pattern Use with setCacheMode(int). | |||||||||
int | LOAD_NO_CACHE | Don't use the cache, load from network Use with setCacheMode(int). |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns true if this WebView supports file access.
| |||||||||||
Return true if the WebView will block network image.
| |||||||||||
Returns true if the zoom mechanism built into WebView is being used.
| |||||||||||
Return the current setting for overriding the cache mode.
| |||||||||||
Get the cursive font family name.
| |||||||||||
Get the default fixed font size.
| |||||||||||
Get the default font size.
| |||||||||||
Get the default text encoding name.
| |||||||||||
Get the fantasy font family name.
| |||||||||||
Get the fixed font family name.
| |||||||||||
Return true if javascript can open windows automatically.
| |||||||||||
Return true if javascript is enabled.
| |||||||||||
Return the current layout algorithm.
| |||||||||||
Returns true if light touches are enabled.
| |||||||||||
Return true if the WebView will load image resources automatically.
| |||||||||||
Get the minimum font size.
| |||||||||||
Get the minimum logical font size.
| |||||||||||
Returns true if dumping the navigation cache is enabled.
| |||||||||||
Return true if plugins are enabled.
| |||||||||||
Return the current path used for plugins in the WebView.
| |||||||||||
Get the sans-serif font family name.
| |||||||||||
Return whether the WebView is saving form data.
| |||||||||||
Return whether the WebView is saving password.
| |||||||||||
Get the serif font family name.
| |||||||||||
Get the standard font family name.
| |||||||||||
Get the text size of the page.
| |||||||||||
Return true if the WebView is using the double tree rendering algorithm.
| |||||||||||
This method is deprecated.
Please use getUserAgentString instead.
| |||||||||||
Return the WebView's user-agent string.
| |||||||||||
Enable or disable file access within WebView.
| |||||||||||
Tell the WebView to block network image.
| |||||||||||
Sets whether the zoom mechanism built into WebView is used.
| |||||||||||
Override the way the cache is used.
| |||||||||||
Set the cursive font family name.
| |||||||||||
Set the default fixed font size.
| |||||||||||
Set the default font size.
| |||||||||||
Set the default text encoding name to use when decoding html pages.
| |||||||||||
Set the fantasy font family name.
| |||||||||||
Set the fixed font family name.
| |||||||||||
Tell javascript to open windows automatically.
| |||||||||||
Tell the WebView to enable javascript execution.
| |||||||||||
Set the underlying layout algorithm.
| |||||||||||
Enables using light touches to make a selection and activate mouseovers.
| |||||||||||
Tell the WebView to load image resources automatically.
| |||||||||||
Set the minimum font size.
| |||||||||||
Set the minimum logical font size.
| |||||||||||
Enables dumping the pages navigation cache to a text file.
| |||||||||||
Tell the WebView whether it needs to set a node to have focus when
requestFocus(int, android.graphics.Rect) is called.
| |||||||||||
Tell the WebView to enable plugins.
| |||||||||||
Set a custom path to plugins used by the WebView.
| |||||||||||
Set the priority of the Render thread.
| |||||||||||
Set the sans-serif font family name.
| |||||||||||
Store whether the WebView is saving form data.
| |||||||||||
Store whether the WebView is saving password.
| |||||||||||
Set the serif font family name.
| |||||||||||
Set the standard font family name.
| |||||||||||
Tell the WebView whether it supports multiple windows.
| |||||||||||
Set whether the WebView supports zoom
| |||||||||||
Set the text size of the page.
| |||||||||||
Tell the WebView to use the double tree rendering algorithm.
| |||||||||||
Tell the WebView to use the wide viewport
| |||||||||||
This method is deprecated.
Please use setUserAgentString instead.
| |||||||||||
Set the WebView's user-agent string.
| |||||||||||
Returns whether the WebView supports zoom
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Use cache if content is there, even if expired (eg, history nav) If it is not in the cache, load from network. Use with setCacheMode(int).
Don't use the network, load from cache only. Use with setCacheMode(int).
Default cache usage pattern Use with setCacheMode(int).
Normal cache usage pattern Use with setCacheMode(int).
Don't use the cache, load from network Use with setCacheMode(int).
Returns true if this WebView supports file access.
Return true if the WebView will block network image.
Returns true if the zoom mechanism built into WebView is being used.
Return the current setting for overriding the cache mode. For a full description, see the setCacheMode(int) function.
Get the cursive font family name.
Get the default fixed font size.
Get the default font size.
Get the default text encoding name.
Get the fantasy font family name.
Get the fixed font family name.
Return true if javascript can open windows automatically.
Return true if javascript is enabled.
Return the current layout algorithm.
Returns true if light touches are enabled.
Return true if the WebView will load image resources automatically.
Get the minimum font size.
Get the minimum logical font size.
Returns true if dumping the navigation cache is enabled.
Return true if plugins are enabled.
Return the current path used for plugins in the WebView.
Get the sans-serif font family name.
Return whether the WebView is saving form data.
Return whether the WebView is saving password.
Get the serif font family name.
Get the standard font family name.
Get the text size of the page.
Return true if the WebView is using the double tree rendering algorithm.
This method is deprecated.Please use getUserAgentString instead.
Return user-agent as int
Return the WebView's user-agent string.
Enable or disable file access within WebView. File access is enabled by default.
Tell the WebView to block network image. This is only checked when getLoadsImagesAutomatically() is true.
flag | True if the WebView should block network image |
---|
Sets whether the zoom mechanism built into WebView is used.
Override the way the cache is used. The way the cache is used is based on the navigation option. 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 pulled from the cache. This function allows the client to override this behavior.
mode | One of the LOAD_ values. |
---|
Set the cursive font family name.
font | A font family name. |
---|
Set the default fixed font size.
size | A non-negative integer between 1 and 72. Any number outside the specified range will be pinned. |
---|
Set the default font size.
size | A non-negative integer between 1 and 72. Any number outside the specified range will be pinned. |
---|
Set the default text encoding name to use when decoding html pages.
encoding | The text encoding name. |
---|
Set the fantasy font family name.
font | A font family name. |
---|
Set the fixed font family name.
font | A font family name. |
---|
Tell javascript to open windows automatically. This applies to the javascript function window.open().
flag | True if javascript can open windows automatically. |
---|
Tell the WebView to enable javascript execution.
flag | True if the WebView should execute javascript. |
---|
Set the underlying layout algorithm. This will cause a relayout of the WebView.
l | A LayoutAlgorithm enum specifying the algorithm to use. |
---|
Enables using light touches to make a selection and activate mouseovers.
Tell the WebView to load image resources automatically.
flag | True if the WebView should load images automatically. |
---|
Set the minimum font size.
size | A non-negative integer between 1 and 72. Any number outside the specified range will be pinned. |
---|
Set the minimum logical font size.
size | A non-negative integer between 1 and 72. Any number outside the specified range will be pinned. |
---|
Enables dumping the pages navigation cache to a text file.
Tell the WebView whether it needs to set a node to have focus when requestFocus(int, android.graphics.Rect) is called.
Tell the WebView to enable plugins.
flag | True if the WebView should load plugins. |
---|
Set a custom path to plugins used by the WebView. The client must ensure it exists before this call.
pluginsPath | String path to the directory containing plugins. |
---|
Set the priority of the Render thread. Unlike the other settings, this one only needs to be called once per process.
priority | RenderPriority, can be normal, high or low. |
---|
Set the sans-serif font family name.
font | A font family name. |
---|
Store whether the WebView is saving form data.
Store whether the WebView is saving password.
Set the serif font family name.
font | A font family name. |
---|
Set the standard font family name.
font | A font family name. |
---|
Tell the WebView whether it supports multiple windows. TRUE means that onCreateWindow(WebView, boolean, boolean, Message) is implemented by the host application.
Set whether the WebView supports zoom
Set the text size of the page.
t | A TextSize value for increasing or decreasing the text. |
---|
Tell the WebView to use the double tree rendering algorithm.
use | True if the WebView is to use double tree rendering, false otherwise. |
---|
Tell the WebView to use the wide viewport
This method is deprecated.Please use setUserAgentString instead.
Tell the WebView about user-agent string.
ua | 0 if the WebView should use an Android user-agent string, 1 if the WebView should use a desktop user-agent string. |
---|
Set the WebView's user-agent string. If the string "ua" is null or empty, it will use the system default user-agent string.
Returns whether the WebView supports zoom