Added in API level 23

WebMessage


open class WebMessage
kotlin.Any
   ↳ android.webkit.WebMessage

The Java representation of the HTML5 PostMessage event. See https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces for definition of a MessageEvent in HTML5.

Summary

Public constructors

Creates a WebMessage.

WebMessage(data: String!, ports: Array<WebMessagePort!>!)

Creates a WebMessage.

Public methods
open String!

Returns the data of the message.

open Array<WebMessagePort!>?

Returns the ports that are sent with the message, or null if no port is sent.

Public constructors

WebMessage

Added in API level 23
WebMessage(data: String!)

Creates a WebMessage.

Parameters
data String!: the data of the message.

WebMessage

Added in API level 23
WebMessage(
    data: String!,
    ports: Array<WebMessagePort!>!)

Creates a WebMessage.

Parameters
data String!: the data of the message.
ports Array<WebMessagePort!>!: the ports that are sent with the message.

Public methods

getData

Added in API level 23
open fun getData(): String!

Returns the data of the message.

getPorts

Added in API level 23
open fun getPorts(): Array<WebMessagePort!>?

Returns the ports that are sent with the message, or null if no port is sent.