当前位置: 首页>>代码示例>>Java>>正文


Java ValueCallback类代码示例

本文整理汇总了Java中com.tencent.smtt.sdk.ValueCallback的典型用法代码示例。如果您正苦于以下问题:Java ValueCallback类的具体用法?Java ValueCallback怎么用?Java ValueCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValueCallback类属于com.tencent.smtt.sdk包,在下文中一共展示了ValueCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeSessionCookies

import com.tencent.smtt.sdk.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,项目名称:AgentWebX5,代码行数:19,代码来源:AgentWebX5Config.java

示例2: openFileChooserAboveL

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
private void openFileChooserAboveL(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {


        Activity mActivity = this.mActivityWeakReference.get();
        if (mActivity == null||mActivity.isFinishing()){
            filePathCallback.onReceiveValue(new Uri[]{});
            return;
        }
        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();

    }
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:21,代码来源:DefaultChromeClient.java

示例3: createAndOpenCommonFileLoader

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
private void createAndOpenCommonFileLoader(ValueCallback valueCallback) {
    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)
            .build();
    this.mIFileUploadChooser.openFileChooser();

}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:17,代码来源:DefaultChromeClient.java

示例4: linkBridge

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
public void linkBridge() {
    if (messagingEnabled) {
        if (ReactBuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            // See isNative in lodash
            String testPostMessageNative = "String(window.postMessage) === String(Object.hasOwnProperty).replace('hasOwnProperty', 'postMessage')";
            evaluateJavascript(testPostMessageNative, new ValueCallback<String>() {
                @Override
                public void onReceiveValue(String value) {
                    if (value.equals("true")) {
                        FLog.w(ReactConstants.TAG, "Setting onMessage on a WebView overrides existing values of window.postMessage, but a previous value was defined");
                    }
                }
            });
        }

        loadUrl("javascript:(" +
                "window.originalPostMessage = window.postMessage," +
                "window.postMessage = function(data) {" +
                BRIDGE_NAME + ".postMessage(String(data));" +
                "}" +
                ")");
    }
}
 
开发者ID:shimohq,项目名称:react-native-x5,代码行数:24,代码来源:RNX5WebViewManager.java

示例5: onShowFileChooser

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
@Override
      public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams)
{
          uploadMessageAboveL = filePathCallback;
          openImageChooserActivity();
          return true;
      }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:8,代码来源:x5_MainActivity.java

示例6: getVisitedHistory

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
public void getVisitedHistory(ValueCallback<String[]> callback) {
    if (this.mRealWebChromeClient != null){
        this.mRealWebChromeClient.getVisitedHistory(callback);
        return ;
    }
    super.getVisitedHistory(callback);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:8,代码来源:WebChromeClientWrapper.java

示例7: onShowFileChooser

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback,
                                 FileChooserParams fileChooserParams) {
    if (this.mRealWebChromeClient != null)
        return this.mRealWebChromeClient.onShowFileChooser(webView, filePathCallback, fileChooserParams);
    return super.onShowFileChooser(webView,filePathCallback,fileChooserParams);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:8,代码来源:WebChromeClientWrapper.java

示例8: removeAllCookies

import com.tencent.smtt.sdk.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,项目名称:AgentWebX5,代码行数:14,代码来源:AgentWebX5Config.java

示例9: getDefaultIgnoreCallback

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
private static ValueCallback<Boolean> getDefaultIgnoreCallback() {

        return new ValueCallback<Boolean>() {
            @Override
            public void onReceiveValue(Boolean ignore) {
                LogUtils.i("Info", "removeExpiredCookies:" + ignore);
            }
        };
    }
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:10,代码来源:AgentWebX5Config.java

示例10: onShowFileChooser

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
    LogUtils.i(TAG, "openFileChooser>=5.0");
    if (AgentWebX5Utils.isOverriedMethod(mWebChromeClient, "onShowFileChooser", ChromePath + ".onShowFileChooser", WebView.class, ValueCallback.class, WebChromeClient.FileChooserParams.class)) {

        return super.onShowFileChooser(webView, filePathCallback, fileChooserParams);
    }
    openFileChooserAboveL(webView, filePathCallback, fileChooserParams);
    return true;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:12,代码来源:DefaultChromeClient.java

示例11: openFileChooser

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
public void openFileChooser(ValueCallback<Uri> uploadFile, String acceptType, String capture) {
    /*believe me , i never want to do this */
    LogUtils.i(TAG, "openFileChooser>=4.1");
    if (AgentWebX5Utils.isOverriedMethod(mWebChromeClient, "openFileChooser", ChromePath + ".openFileChooser", ValueCallback.class, String.class, String.class)) {
        super.openFileChooser(uploadFile, acceptType, capture);
        return;
    }
    createAndOpenCommonFileLoader(uploadFile);
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:10,代码来源:DefaultChromeClient.java

示例12: setUriValueCallback

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
public Builder setUriValueCallback(ValueCallback<Uri> uriValueCallback) {
    mUriValueCallback = uriValueCallback;
    isL = false;
    jsChannel = false;
    mUriValueCallbacks = null;
    mJsChannelCallback = null;
    return this;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:9,代码来源:FileUpLoadChooserImpl.java

示例13: setUriValueCallbacks

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
public Builder setUriValueCallbacks(ValueCallback<Uri[]> uriValueCallbacks) {
    mUriValueCallbacks = uriValueCallbacks;
    isL = true;
    mUriValueCallback = null;
    mJsChannelCallback = null;
    jsChannel = false;
    return this;
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:9,代码来源:FileUpLoadChooserImpl.java

示例14: openFileChooser

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
    ((EBrowserActivity) mContext).setmUploadMessage(getCompatCallback(uploadMsg));
    Intent i = new Intent(Intent.ACTION_GET_CONTENT);
    i.addCategory(Intent.CATEGORY_OPENABLE);
    i.setType("image/*");
    ((EBrowserActivity) mContext).startActivityForResult(Intent.createChooser(i, "File Chooser"),
            EBrowserActivity.FILECHOOSER_RESULTCODE);
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:9,代码来源:CBrowserMainFrame.java

示例15: getCompatCallback

import com.tencent.smtt.sdk.ValueCallback; //导入依赖的package包/类
public WebViewSdkCompat.ValueCallback<Uri> getCompatCallback(final ValueCallback<Uri> uploadMsg){
    return new WebViewSdkCompat.ValueCallback<Uri>() {
        @Override
        public void onReceiveValue(Uri uri) {
            uploadMsg.onReceiveValue(uri);
        }
    };
}
 
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:9,代码来源:CBrowserMainFrame.java


注:本文中的com.tencent.smtt.sdk.ValueCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。