Choose image from gallery and camera through web view is not working in Android 6.0 Marshmallow

后端 未结 3 1938
再見小時候
再見小時候 2020-12-15 10:15

Here is my code. I am using WebView for registration purposes. In the registration process I have to upload an image from the device. I have finished the code for this and i

3条回答
  •  天命终不由人
    2020-12-15 10:40

    This code below will let you selecting multiple images/files

    At onActivityResult include the following code:

    if (resultCode == Activity.RESULT_OK) {
        if (null != data.getClipData()) {
            final int numSelectedFiles = data.getClipData().getItemCount();
            results = new Uri[numSelectedFiles];
            for (int i = 0; i < data.getClipData().getItemCount(); i++) {
                results[i] = data.getClipData().getItemAt(i).getUri();
            }
        }
    }
    

提交回复
热议问题