安卓webview上传文件

后端jsp

客户端

           @Override
            public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
                uploadMessageAboveL = filePathCallback;

                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
                intent.addCategory(Intent.CATEGORY_OPENABLE);
                intent.setType("*/*");
                startActivityForResult(Intent.createChooser(intent, "Image Chooser"), REQUEST_CODE_FILE_CHOOSE);

                return true;
            }

猜你喜欢

转载自blog.csdn.net/h517604180/article/details/80860427