我的应用程序中有一个 webview。网页中有一个浏览(上传文件)按钮。当我在 HTC (Android 4.0.3) 中测试应用程序时,它可以工作,但在 Galaxy S3 (Android 4.1.1) 中它不工作。
我不会得到文件选择器菜单。显然,当我触摸屏幕的任何位置时,按钮是不可点击的
“singleCursorHandlerTouchEvent -getEditableSupport FASLE”。
我已经尝试了所有可能的解决方案。
    // Profile web view
    mWebView = (WebView) findViewById(R.id.itemWebView);
    //improve the speed
    mWebView.getSettings().setRenderPriority(RenderPriority.HIGH);
    mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setSupportZoom(false);
    //setup the file chooser
    mWebView.setWebChromeClient(new WebChromeClient() {
        public void openFileChooser(ValueCallback<Uri> uploadMsg) {  
            mUploadMessage = uploadMsg;
            Intent i = new Intent(Intent.ACTION_GET_CONTENT);
            i.addCategory(Intent.CATEGORY_OPENABLE);
            i.setType("image/*");
            ProfileActivity.this.startActivityForResult(Intent.createChooser(i, "Image Chooser"),FILECHOOSER_RESULTCODE);
        }
        @SuppressWarnings("unused")
        public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
            openFileChooser(uploadMsg);
        }
        @SuppressWarnings("unused")
        public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
            openFileChooser(uploadMsg);
        } 
    });
这是我的 onActivityResult 函数
protected void onActivityResult(int requestCode, int resultCode,
        Intent intent) {
    if (requestCode == FILECHOOSER_RESULTCODE) {
        if (null == mUploadMessage)
            return;
        Uri result = intent == null || resultCode != RESULT_OK ? null
                : intent.getData();
        mUploadMessage.onReceiveValue(result);
        mUploadMessage = null;
    } else {
        System.out.println("Something else->" + requestCode);
    }
}
在我的 jQuery 移动网页中,我有一个简单的表单:
<form id="edit" method="post" enctype="multipart/form-data" data-ajax="false" action = "profile_myimage.php">
            <div data-role="fieldcontain">
                <label for="image" class="required">Select photo</label>
                <input type="file" name="image" id="image" />
                <p class="error_message" id="img"><p>
            </div>
请帮我解决这个问题。我感谢您的支持。