其他的都挖下来了吗、?能给我一份吗,谢谢

解决方案 »

  1.   

    开启 WebView 的文件上传功能;
    Android 的 话, 在WebViewClient 中设置, 可以设置上传类型为图片, 会自动打开相册; /***************** android中使用WebView来打开本机的文件选择器 *************************/  
            // js上传文件的<input type="file" name="fileField" id="fileField" />事件捕获  
            // Android > 4.1.1 调用这个方法  
            public void openFileChooser(ValueCallback<Uri> uploadMsg,  
                    String acceptType, String capture) {  
                mUploadMessage = uploadMsg;  
                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);  
                intent.addCategory(Intent.CATEGORY_OPENABLE);  
                intent.setType("image/*");  
                context.startActivityForResult(  
                        Intent.createChooser(intent, "完成操作需要使用"),  
                        WebMainActivity.FILECHOOSER_RESULTCODE);  
      
            }  
      
            // 3.0 + 调用这个方法  
            public void openFileChooser(ValueCallback<Uri> uploadMsg,  
                    String acceptType) {  
                mUploadMessage = uploadMsg;  
                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);  
                intent.addCategory(Intent.CATEGORY_OPENABLE);  
                intent.setType("image/*");  
                context.startActivityForResult(  
                        Intent.createChooser(intent, "完成操作需要使用"),  
                        WebMainActivity.FILECHOOSER_RESULTCODE);  
            }  
      
            // Android < 3.0 调用这个方法  
            public void openFileChooser(ValueCallback<Uri> uploadMsg) {  
                mUploadMessage = uploadMsg;  
                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);  
                intent.addCategory(Intent.CATEGORY_OPENABLE);  
                intent.setType("image/*");  
                context.startActivityForResult(  
                        Intent.createChooser(intent, "完成操作需要使用"),  
                        WebMainActivity.FILECHOOSER_RESULTCODE);  
      
            }  
            /************** end ***************/