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


Java ValueCallback.onReceiveValue方法代碼示例

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


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

示例1: removeSessionCookies

import android.webkit.ValueCallback; //導入方法依賴的package包/類
public static void removeSessionCookies(ValueCallback<Boolean> callback) {

        if (callback == null)
            callback = getDefaultIgnoreCallback();
        if (CookieManager.getInstance() == null) {
            callback.onReceiveValue(new Boolean(false));
            return;
        }
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
            CookieManager.getInstance().removeSessionCookie();
            toSyncCookies();
            callback.onReceiveValue(new Boolean(true));
            return;
        }
        CookieManager.getInstance().removeSessionCookies(callback);
        toSyncCookies();

    }
 
開發者ID:Justson,項目名稱:AgentWeb,代碼行數:19,代碼來源:AgentWebConfig.java

示例2: openFileChooserAboveL

import android.webkit.ValueCallback; //導入方法依賴的package包/類
private boolean openFileChooserAboveL(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {


        LogUtils.i(TAG, "fileChooserParams:" + fileChooserParams.getAcceptTypes() + "  getTitle:" + fileChooserParams.getTitle() + " accept:" + Arrays.toString(fileChooserParams.getAcceptTypes()) + " length:" + fileChooserParams.getAcceptTypes().length + "  :" + fileChooserParams.isCaptureEnabled() + "  " + fileChooserParams.getFilenameHint() + "  intent:" + fileChooserParams.createIntent().toString()+"   mode:"+fileChooserParams.getMode());

        Activity mActivity = this.mActivityWeakReference.get();
        if (mActivity == null || mActivity.isFinishing()) {
            filePathCallback.onReceiveValue(new Uri[]{});
            return false;
        }
        IFileUploadChooser mIFileUploadChooser = this.mIFileUploadChooser;
        this.mIFileUploadChooser = mIFileUploadChooser = new FileUpLoadChooserImpl.Builder()
                .setWebView(webView)
                .setActivity(mActivity)
                .setUriValueCallbacks(filePathCallback)
                .setFileChooserParams(fileChooserParams)
                .setFileUploadMsgConfig(mChromeClientMsgCfg.getFileUploadMsgConfig())
                .setPermissionInterceptor(this.mPermissionInterceptor)
                .build();
        mIFileUploadChooser.openFileChooser();
        return true;

    }
 
開發者ID:Justson,項目名稱:AgentWeb,代碼行數:24,代碼來源:DefaultChromeClient.java

示例3: createAndOpenCommonFileLoader

import android.webkit.ValueCallback; //導入方法依賴的package包/類
private void createAndOpenCommonFileLoader(ValueCallback valueCallback, String mimeType) {
    Activity mActivity = this.mActivityWeakReference.get();
    if (mActivity == null || mActivity.isFinishing()) {
        valueCallback.onReceiveValue(new Object());
        return;
    }
    this.mIFileUploadChooser = new FileUpLoadChooserImpl.Builder()
            .setWebView(this.mWebView)
            .setActivity(mActivity)
            .setUriValueCallback(valueCallback)
            .setFileUploadMsgConfig(mChromeClientMsgCfg.getFileUploadMsgConfig())
            .setPermissionInterceptor(this.mPermissionInterceptor)
            .setAcceptType(mimeType)
            .build();
    this.mIFileUploadChooser.openFileChooser();

}
 
開發者ID:Justson,項目名稱:AgentWeb,代碼行數:18,代碼來源:DefaultChromeClient.java

示例4: evaluateJavascript

import android.webkit.ValueCallback; //導入方法依賴的package包/類
@Override
public void evaluateJavascript(String js, ValueCallback<String> callback) {

    if(callback == null)
        webView.evaluateJavascript(js,null);

     final ValueCallback<String> proxyCallback = callback;
     com.tencent.smtt.sdk.ValueCallback mCallback = new com.tencent.smtt.sdk.ValueCallback() {
        @Override
        public void onReceiveValue(Object o) {
            if(o instanceof String)
                proxyCallback.onReceiveValue((String) o);
        }
    };
    webView.evaluateJavascript(js,mCallback);
}
 
開發者ID:runner525,項目名稱:x5webview-cordova-plugin,代碼行數:17,代碼來源:X5WebViewEngine.java

示例5: removeSessionCookies

import android.webkit.ValueCallback; //導入方法依賴的package包/類
public static void removeSessionCookies(ValueCallback<Boolean> callback) {

        if (callback == null)
            callback = getDefaultIgnoreCallback();
        if (CookieManager.getInstance() == null) {
            callback.onReceiveValue(new Boolean(false));
            return;
        }
        if (!SysUtils.hasLollipop()) {
            CookieManager.getInstance().removeSessionCookie();
            toSyncCookies();
            callback.onReceiveValue(new Boolean(true));
            return;
        } else {

            CookieManager.getInstance().removeSessionCookies(callback);
        }
        toSyncCookies();

    }
 
開發者ID:wzx54321,項目名稱:XinFramework,代碼行數:21,代碼來源:CookiesHandler.java

示例6: removeAllCookies

import android.webkit.ValueCallback; //導入方法依賴的package包/類
public static void removeAllCookies(@Nullable ValueCallback<Boolean> callback) {

        if (callback == null)
            callback = getDefaultIgnoreCallback();
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
            CookieManager.getInstance().removeAllCookie();
            toSyncCookies();
            callback.onReceiveValue(!CookieManager.getInstance().hasCookies());
            return;
        }
        CookieManager.getInstance().removeAllCookies(callback);
        toSyncCookies();
    }
 
開發者ID:Justson,項目名稱:AgentWeb,代碼行數:14,代碼來源:AgentWebConfig.java

示例7: removeAllCookies

import android.webkit.ValueCallback; //導入方法依賴的package包/類
public static void removeAllCookies(@Nullable ValueCallback<Boolean> callback) {

        if (callback == null)
            callback = getDefaultIgnoreCallback();
        if (!SysUtils.hasLollipop()) {
            CookieManager.getInstance().removeAllCookie();
            toSyncCookies();
            callback.onReceiveValue(!CookieManager.getInstance().hasCookies());
            return;
        } else {

            CookieManager.getInstance().removeAllCookies(callback);
        }
        toSyncCookies();
    }
 
開發者ID:wzx54321,項目名稱:XinFramework,代碼行數:16,代碼來源:CookiesHandler.java

示例8: onReceivedSslError

import android.webkit.ValueCallback; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(XWalkView view, ValueCallback<Boolean> callback, SslError error) {
    callback.onReceiveValue(true);
}
 
開發者ID:xm0625,項目名稱:VBrowser-Android,代碼行數:5,代碼來源:MainActivity.java


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