public class NativeToJsMessageQueue
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NativeToJsMessageQueue.BridgeMode |
static class |
NativeToJsMessageQueue.EvalBridgeMode
Uses webView.evaluateJavascript to execute messages.
|
static class |
NativeToJsMessageQueue.LoadUrlBridgeMode
Uses webView.loadUrl("javascript:") to execute messages.
|
static class |
NativeToJsMessageQueue.NoOpBridgeMode
Uses JS polls for messages on a timer..
|
static class |
NativeToJsMessageQueue.OnlineEventsBridgeMode
Uses online/offline events to tell the JS when to poll for messages.
|
Constructor and Description |
---|
NativeToJsMessageQueue() |
Modifier and Type | Method and Description |
---|---|
void |
addBridgeMode(NativeToJsMessageQueue.BridgeMode bridgeMode) |
void |
addJavaScript(java.lang.String statement)
Add a JavaScript statement to the list.
|
void |
addPluginResult(PluginResult result,
java.lang.String callbackId)
Add a JavaScript statement to the list.
|
boolean |
isBridgeEnabled() |
boolean |
isEmpty() |
java.lang.String |
popAndEncode(boolean fromOnlineEvent)
Combines and returns queued messages combined into a single string.
|
java.lang.String |
popAndEncodeAsJs()
Same as popAndEncode(), except encodes in a form that can be executed as JS.
|
void |
reset()
Clears all messages and resets to the default bridge mode.
|
void |
setBridgeMode(int value)
Changes the bridge mode.
|
void |
setPaused(boolean value) |
public void addBridgeMode(NativeToJsMessageQueue.BridgeMode bridgeMode)
public boolean isBridgeEnabled()
public boolean isEmpty()
public void setBridgeMode(int value)
public void reset()
public java.lang.String popAndEncode(boolean fromOnlineEvent)
public java.lang.String popAndEncodeAsJs()
public void addJavaScript(java.lang.String statement)
public void addPluginResult(PluginResult result, java.lang.String callbackId)
public void setPaused(boolean value)