这只是不工作。
我这样做
webView.setWebChromeClient(new WebChromeClient() {
public void openFileChooser(ValueCallback<Uri> uploadFile) {
System.out.println("openFileChooser");
mUploadMessage = uploadFile;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("file/*");
PresentationActivity.this.startActivityForResult(
Intent.createChooser(i, "Image Browser"),
FILECHOOSER_RESULTCODE);
}
});
但openFileChooser永远不会被调用。 有任何想法吗? openFileChooser标记@hide在Android源$ C $ C。 我认为它的,因为你不应该使用这种方法。是否有其他方式来打开文件选择器??
but openFileChooser is never called. Any ideas? openFileChooser is marked @hide in Android source code. I think its because you should NOT use this method. Is there another possibility to open a fileChooser??
参数已经更新了一些时间。
Parameters for openFileChooser have been updated some times.
有关的Android 3.0 - 4.0,这是
For Android 3.0 - 4.0, it is
public void openFileChooser( ValueCallback<Uri> uploadMsg, String acceptType )
4.1,
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture)
和2.X
public void openFileChooser( ValueCallback<Uri> uploadMsg )
您必须添加所有的人都支持Android 2.0和4.1之间的任何设备。
You'll have to add all of them to support any devices between Android 2.0 and 4.1.
上一篇:嵌入的YouTube视频不工作在web视图。有什么不对的code?有什么、视图、工作、视频
下一篇:有没有一种更聪明的办法不是忙等待检查System.Net.WebClient.DownloadFileAsync下载完成()?更聪明、办法、不是、下载完成