WebView Android 4.0 file upload

后端 未结 1 676
别跟我提以往
别跟我提以往 2021-01-12 16:43

It\'s just NOT working.

I\'m doing this

webView.setWebChromeClient(new WebChromeClient() {

        public void openFileChooser(ValueCallback

        
相关标签:
1条回答
  • 2021-01-12 17:03

    Parameters for openFileChooser have been updated some times.

    For Android 3.0 - 4.0, it is

    public void openFileChooser( ValueCallback<Uri> uploadMsg, String acceptType )
    

    for 4.1,

    public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture)
    

    and for 2.x

    public void openFileChooser( ValueCallback<Uri> uploadMsg )
    

    You'll have to add all of them to support any devices between Android 2.0 and 4.1.

    0 讨论(0)
提交回复
热议问题