本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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));" +
"}" +
")");
}
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
};
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
};
}