List of usage examples for org.apache.cordova PluginResult setKeepCallback
public void setKeepCallback(boolean b)
From source file:it.alfonsovinti.cordova.plugins.bixolonprint.BixolonPrint.java
License:Open Source License
private void sendConnectionData() { if (this.connectionListenerCallbackContext != null) { PluginResult result = new PluginResult(PluginResult.Status.OK, createConnectionData(null)); result.setKeepCallback(true); this.connectionListenerCallbackContext.sendPluginResult(result); }/* ww w .jav a 2 s .c om*/ }
From source file:jdev.cordova.thread.ThreadHelper.java
private void successCallback(CallbackContext callbackContext, int i) { PluginResult result = new PluginResult(PluginResult.Status.OK, i); result.setKeepCallback(true); callbackContext.sendPluginResult(result); }
From source file:jdev.cordova.thread.ThreadHelper.java
private void successCallback(CallbackContext callbackContext) { PluginResult result = new PluginResult(PluginResult.Status.OK); result.setKeepCallback(true); callbackContext.sendPluginResult(result); }
From source file:jdev.cordova.thread.ThreadHelper.java
private void successCallback(CallbackContext callbackContext, String msg) { PluginResult result = new PluginResult(PluginResult.Status.OK, msg); result.setKeepCallback(true); callbackContext.sendPluginResult(result); }
From source file:jdev.cordova.thread.ThreadHelper.java
private void errorCallback(CallbackContext callbackContext, int i) { PluginResult result = new PluginResult(PluginResult.Status.ERROR, i); result.setKeepCallback(true); callbackContext.sendPluginResult(result); }
From source file:jdev.cordova.thread.ThreadHelper.java
private void errorCallback(CallbackContext callbackContext, String msg) { PluginResult result = new PluginResult(PluginResult.Status.ERROR, msg); result.setKeepCallback(true); callbackContext.sendPluginResult(result); }
From source file:jdev.guardian.service.GuardianService.java
protected void callBack(Result result) { PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, result.toJson()); pluginResult.setKeepCallback(true); CallbackContext.sendPluginResult(pluginResult); }
From source file:jp.raku_za.baas.cordova.android.impl.BeaconReceiverBridge.java
private void send(PluginResult.Status status, Object info, Boolean keepCallback) { if (mReceiveCallbackContext != null) { JSONObject json;/*from ww w . j a v a 2 s. com*/ try { PluginResult result; if (info != null) { json = convertToJSONObject(info); result = new PluginResult(status, json); } else { result = new PluginResult(status); } result.setKeepCallback(keepCallback); mReceiveCallbackContext.sendPluginResult(result); } catch (JSONException e1) { try { json = convertToJSONObject(e1.getMessage()); PluginResult result = new PluginResult(PluginResult.Status.JSON_EXCEPTION, json); result.setKeepCallback(keepCallback); mReceiveCallbackContext.sendPluginResult(result); } catch (JSONException e2) { PluginResult result = new PluginResult(PluginResult.Status.JSON_EXCEPTION); result.setKeepCallback(keepCallback); mReceiveCallbackContext.sendPluginResult(result); } } } }
From source file:labs.marsala.trackinfo.CurrentlyPlaying.java
License:Apache License
/** * Executes the request and returns PluginResult. * * @param action The action to execute. * @param args JSONArry of arguments for the plugin. * @param callbackContext The callback id used when calling back into JavaScript. * @return True if the action was valid, false otherwise. */// w w w. j a v a 2 s .c om public boolean execute(String action, JSONArray args, CallbackContext callbackContext) { if (action.equals("getMusicInfo")) { this.musicCallbackContext = callbackContext; PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, lastMusic); pluginResult.setKeepCallback(true); callbackContext.sendPluginResult(pluginResult); return true; } return false; }
From source file:labs.marsala.trackinfo.CurrentlyPlaying.java
License:Apache License
/** * Create a new plugin result and send it back to JavaScript * * @param/*from www . jav a 2 s. co m*/ */ private void sendUpdate(String music) { if (musicCallbackContext != null) { PluginResult result = new PluginResult(PluginResult.Status.OK, music); result.setKeepCallback(true); musicCallbackContext.sendPluginResult(result); } webView.postMessage("currentplaying", music); lastMusic = music; }