能解决html5安卓4.4+ webview不支持input type=file标签的问题吗
1个回答
2015-07-16
展开全部
mWebView.getSettings().setJavaScriptEnabled(true);
这个只是支持javascript,对html5不起作用
可以阅读下WebChromeClient的源码,我就摘抄下吧
/**
* Tell the client to open a file chooser.
* @param uploadFile A ValueCallback to set the URI of the file to upload.
* onReceiveValue must be called to wake up the thread.a
* @param acceptType The value of the 'accept' attribute of the input tag
* associated with this file picker.
* @hide
*/如果不管用添加这个方法
public void openFileChooser(ValueCallback<Uri> uploadFile, String acceptType,String capture)
因为Android API变化了。
这个只是支持javascript,对html5不起作用
可以阅读下WebChromeClient的源码,我就摘抄下吧
/**
* Tell the client to open a file chooser.
* @param uploadFile A ValueCallback to set the URI of the file to upload.
* onReceiveValue must be called to wake up the thread.a
* @param acceptType The value of the 'accept' attribute of the input tag
* associated with this file picker.
* @hide
*/如果不管用添加这个方法
public void openFileChooser(ValueCallback<Uri> uploadFile, String acceptType,String capture)
因为Android API变化了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询