android-components / mozilla.components.concept.engine / EngineSession / loadData

loadData

abstract fun loadData(data: String, mimeType: String = "text/html", encoding: String = "UTF-8"): Unit (source)

Loads the data with the given mimeType. Example:

engineSession.loadData("<html><body>Example HTML content here</body></html>", "text/html")

If the data is base64 encoded, you can override the default encoding (UTF-8) with ‘base64’. Example:

engineSession.loadData("ahr0cdovl21vemlsbgeub3jn==", "text/plain", "base64")

Parameters

data - The data that should be rendering.

mimeType - the data type needed by the engine to know how to render it.

encoding - specifies whether the data is base64 encoded; use ‘base64’ else defaults to “UTF-8”.