当前位置: 首页>>代码示例>>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;未经允许,请勿转载。