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


Java PluginResult.getKeepCallback方法代碼示例

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


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

示例1: addPluginResult

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
/**
 * Add a JavaScript statement to the list.
 */
public void addPluginResult(PluginResult result, String callbackId) {
    if (callbackId == null) {
        Log.e(LOG_TAG, "Got plugin result with no callbackId", new Throwable());
        return;
    }
    // Don't send anything if there is no result and there is no need to
    // clear the callbacks.
    boolean noResult = result.getStatus() == PluginResult.Status.NO_RESULT.ordinal();
    boolean keepCallback = result.getKeepCallback();
    if (noResult && keepCallback) {
        return;
    }
    JsMessage message = new JsMessage(result, callbackId);
    if (FORCE_ENCODE_USING_EVAL) {
        StringBuilder sb = new StringBuilder(message.calculateEncodedLength() + 50);
        message.encodeAsJsMessage(sb);
        message = new JsMessage(sb.toString());
    }

    enqueueMessage(message);
}
 
開發者ID:aabognah,項目名稱:LoRaWAN-Smart-Parking,代碼行數:25,代碼來源:NativeToJsMessageQueue.java

示例2: sendPluginResult

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
public void sendPluginResult(PluginResult pluginResult) {
    synchronized (this) {
        if (finished) {
            LOG.w(LOG_TAG, "Attempted to send a second callback for ID: " + callbackId + "\nResult was: " + pluginResult.getMessage());
            return;
        } else {
            finished = !pluginResult.getKeepCallback();
        }
    }
    webView.sendPluginResult(pluginResult, callbackId);
}
 
開發者ID:Andy-Ta,項目名稱:COB,代碼行數:12,代碼來源:CallbackContext.java

示例3: sendPluginResult

import org.apache.cordova.PluginResult; //導入方法依賴的package包/類
public void sendPluginResult(PluginResult pluginResult) {
    synchronized (this) {
        if (finished) {
            Log.w(LOG_TAG, "Attempted to send a second callback for ID: " + callbackId + "\nResult was: " + pluginResult.getMessage());
            return;
        } else {
            finished = !pluginResult.getKeepCallback();
        }
    }
    webView.sendPluginResult(pluginResult, callbackId);
}
 
開發者ID:aabognah,項目名稱:LoRaWAN-Smart-Parking,代碼行數:12,代碼來源:CallbackContext.java


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