Android.Webkit.WebView.LoadData Method
Loads the given data into this WebView using a 'data' scheme URL.

Syntax

[Android.Runtime.Register("loadData", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", "GetLoadData_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual void LoadData (string data, string mimeType, string encoding)

Parameters

data
a String of data in the given encoding
mimeType
the MIME type of the data, e.g. 'text/html'
encoding
the encoding of the data

Remarks

Loads the given data into this WebView using a 'data' scheme URL.

Note that JavaScript's same origin policy means that script running in a page loaded using this method will be unable to access content loaded using any scheme other than 'data', including 'http(s)'. To avoid this restriction, use WebView.LoadDataWithBaseURL(string, System.String, System.String, System.String, System.String) with an appropriate base URL.

The encoding parameter specifies whether the data is base64 or URL encoded. If the data is base64 encoded, the value of the encoding parameter must be 'base64'. For all other values of the parameter, including null, it is assumed that the data uses ASCII encoding for octets inside the range of safe URL characters and use the standard %xx hex encoding of URLs for octets outside that range. For example, '#', '%', '\', '?' should be replaced by %23, %25, %27, %3f respectively.

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 mediatype portion of the URL and call WebView.LoadUrl(string) instead. Note that the charset obtained from the mediatype portion of a data URL always overrides that specified in the HTML or XML document itself.

[Android Documentation]

Requirements

Namespace: Android.Webkit
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1