本文整理汇总了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();
}
示例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;
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例8: onReceivedSslError
import android.webkit.ValueCallback; //导入方法依赖的package包/类
@Override
public void onReceivedSslError(XWalkView view, ValueCallback<Boolean> callback, SslError error) {
callback.onReceiveValue(true);
}