Android APIs
public class

WebMessage

extends Object
java.lang.Object
   ↳ android.webkit.WebMessage

Class Overview

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
WebMessage(String data)
Creates a WebMessage.
WebMessage(String data, WebMessagePort[] ports)
Creates a WebMessage.
Public Methods
String getData()
Returns the data of the message.
WebMessagePort[] getPorts()
Returns the ports that are sent with the message, or null if no port is sent.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WebMessage (String data)

Added in API level 23

Creates a WebMessage.

Parameters
data the data of the message.

public WebMessage (String data, WebMessagePort[] ports)

Added in API level 23

Creates a WebMessage.

Parameters
data the data of the message.
ports the ports that are sent with the message.

Public Methods

public String getData ()

Added in API level 23

Returns the data of the message.

public WebMessagePort[] getPorts ()

Added in API level 23

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