當前位置: 首頁>>代碼示例>>Java>>正文


Java PluginResult.Status方法代碼示例

本文整理匯總了Java中org.apache.cordova.PluginResult.Status方法的典型用法代碼示例。如果您正苦於以下問題:Java PluginResult.Status方法的具體用法?Java PluginResult.Status怎麽用?Java PluginResult.Status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.cordova.PluginResult的用法示例。


在下文中一共展示了PluginResult.Status方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sendUpdate

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
/**
 * Create a new plugin result and send it back to JavaScript
 *
 * @param obj a JSONObject contain event payload information
 * @param status the status code to return to the JavaScript environment
 */
private void sendUpdate(JSONObject obj, boolean keepCallback, PluginResult.Status status) {
    if (callbackContext != null) {
        PluginResult result = new PluginResult(status, obj);
        result.setKeepCallback(keepCallback);
        callbackContext.sendPluginResult(result);
        if (!keepCallback) {
            callbackContext = null;
        }
    }
}
 
開發者ID:dpa99c,項目名稱:cordova-plugin-inappbrowser-wkwebview,代碼行數:17,代碼來源:InAppBrowser.java

示例2: sendUpdate

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
/**
 * Create a new plugin result and send it back to JavaScript
 *
 * @param obj a JSONObject contain event payload information
 * @param status the status code to return to the JavaScript environment
 */    
private void sendUpdate(JSONObject obj, boolean keepCallback, PluginResult.Status status) {
    if (callbackContext != null) {
        PluginResult result = new PluginResult(status, obj);
        result.setKeepCallback(keepCallback);
        callbackContext.sendPluginResult(result);
        if (!keepCallback) {
            callbackContext = null;
        }
    }
}
 
開發者ID:jverlee,項目名稱:cordova-plugin-inappbrowser-camera,代碼行數:17,代碼來源:InAppBrowser.java

示例3: sendCallback

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
private static void sendCallback(PluginResult.Status status, String message){
    if(!Thread.currentThread().isInterrupted()){
        final PluginResult result = new PluginResult(status, message);
        result.setKeepCallback(true);
        _callbackContext.sendPluginResult(result);
    }
}
 
開發者ID:SUTFutureCoder,項目名稱:localcloud_fe,代碼行數:8,代碼來源:CellLocationController.java

示例4: sendCallback

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
/**
 * Callback handler for this Class
 * @param status Message status
 * @param message Any message
 */
private static void sendCallback(PluginResult.Status status, String message){
    if(!Thread.currentThread().isInterrupted()){
        final PluginResult result = new PluginResult(status, message);
        result.setKeepCallback(true);
        _callbackContext.sendPluginResult(result);
    }
}
 
開發者ID:SUTFutureCoder,項目名稱:localcloud_fe,代碼行數:13,代碼來源:GPSController.java

示例5: execute

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
/**
  * Executes the request and returns PluginResult.
  *
  * @param action            The action to execute.
  * @param args              JSONArry of arguments for the plugin.
  * @param callbackContext   The callback context from which we were invoked.
  * @return                  A PluginResult object with a status and message.
  */
 public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
     PluginResult.Status status = PluginResult.Status.OK;
     String result = "";

     try {
         if (action.equals("clearCache")) {
             this.clearCache();
         }
         else if (action.equals("show")) {
             // This gets called from JavaScript onCordovaReady to show the webview.
             // I recommend we change the name of the Message as spinner/stop is not
             // indicative of what this actually does (shows the webview).
             cordova.getActivity().runOnUiThread(new Runnable() {
                 public void run() {
                     webView.postMessage("spinner", "stop");
                 }
             });
         }
         else if (action.equals("loadUrl")) {
             this.loadUrl(args.getString(0), args.optJSONObject(1));
         }
         else if (action.equals("cancelLoadUrl")) {
             //this.cancelLoadUrl();
         }
         else if (action.equals("clearHistory")) {
             this.clearHistory();
         }
         else if (action.equals("backHistory")) {
             this.backHistory();
         }
         else if (action.equals("overrideButton")) {
             this.overrideButton(args.getString(0), args.getBoolean(1));
         }
         else if (action.equals("overrideBackbutton")) {
             this.overrideBackbutton(args.getBoolean(0));
         }
         else if (action.equals("exitApp")) {
             this.exitApp();
         }
else if (action.equals("messageChannel")) {
             messageChannel = callbackContext;
             return true;
         }

         callbackContext.sendPluginResult(new PluginResult(status, result));
         return true;
     } catch (JSONException e) {
         callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
         return false;
     }
 }
 
開發者ID:aabognah,項目名稱:LoRaWAN-Smart-Parking,代碼行數:60,代碼來源:App.java

示例6: sendCallback

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
/**
 * Callback handler for this Class
 * @param status Message status
 * @param message Any message
 */
private static void sendCallback(PluginResult.Status status, String message){
    final PluginResult result = new PluginResult(status, message);
    result.setKeepCallback(true);
    _callbackContext.sendPluginResult(result);
}
 
開發者ID:SUTFutureCoder,項目名稱:localcloud_fe,代碼行數:11,代碼來源:AdvancedGeolocation.java


注:本文中的org.apache.cordova.PluginResult.Status方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。