summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/WebView.java
diff options
context:
space:
mode:
authorJames Wallace-Lee <jamwalla@google.com>2017-12-11 16:11:15 -0800
committerJames Wallace-Lee <jamwalla@google.com>2017-12-12 12:27:30 -0800
commitd38c2e3f344d07fc948df8c49bfbf3e9219f5474 (patch)
tree36937d3795ec470e32f8d9bef1ccf33cce9ab139 /core/java/android/webkit/WebView.java
parent1fa458fd7f19b1d9b2f778ca294c9579d50b7f0f (diff)
WebView: Clarify documentation about mimeTypes
This change edits the WebView documentation to specify that the mimeType parameter to loadData and loadDataWithBaseUrl should be a valid mimeType and the data will be downloaded if it is not. Test: manual - this only changes documentation Bug: 70528830 Change-Id: I58ca4655673c6ccfe7547572579ef86a14a259ed
Diffstat (limited to 'core/java/android/webkit/WebView.java')
-rw-r--r--core/java/android/webkit/WebView.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 6f9925480a22..70080e6f6f15 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -997,6 +997,10 @@ public class WebView extends AbsoluteLayout
* hex encoding of URLs for octets outside that range. For example, '#',
* '%', '\', '?' should be replaced by %23, %25, %27, %3f respectively.
* <p>
+ * The {@code mimeType} parameter specifies the format of the data.
+ * If WebView can't handle the specified MIME type, it will download the data.
+ * If {@code null}, defaults to 'text/html'.
+ * <p>
* The 'data' scheme URL formed by this method uses the default US-ASCII
* charset. If you need need to set a different charset, you should form a
* 'data' scheme URL which explicitly specifies a charset parameter in the
@@ -1005,8 +1009,7 @@ public class WebView extends AbsoluteLayout
* always overrides that specified in the HTML or XML document itself.
*
* @param data a String of data in the given encoding
- * @param mimeType the MIMEType of the data, e.g. 'text/html'. If {@code null},
- * defaults to 'text/html'.
+ * @param mimeType the MIME type of the data, e.g. 'text/html'.
* @param encoding the encoding of the data
*/
public void loadData(String data, @Nullable String mimeType, @Nullable String encoding) {
@@ -1020,6 +1023,10 @@ public class WebView extends AbsoluteLayout
* applying JavaScript's same origin policy. The historyUrl is used for the
* history entry.
* <p>
+ * The {@code mimeType} parameter specifies the format of the data.
+ * If WebView can't handle the specified MIME type, it will download the data.
+ * If {@code null}, defaults to 'text/html'.
+ * <p>
* Note that content specified in this way can access local device files
* (via 'file' scheme URLs) only if baseUrl specifies a scheme other than
* 'http', 'https', 'ftp', 'ftps', 'about' or 'javascript'.
@@ -1037,8 +1044,7 @@ public class WebView extends AbsoluteLayout
* @param baseUrl the URL to use as the page's base URL. If {@code null} defaults to
* 'about:blank'.
* @param data a String of data in the given encoding
- * @param mimeType the MIMEType of the data, e.g. 'text/html'. If {@code null},
- * defaults to 'text/html'.
+ * @param mimeType the MIME type of the data, e.g. 'text/html'.
* @param encoding the encoding of the data
* @param historyUrl the URL to use as the history entry. If {@code null} defaults
* to 'about:blank'. If non-null, this must be a valid URL.