openFileChooser opening 2 times on selecting image from gallery
<p>I implemented openFileChooser of webchromeclient which is opening a PHP page. When i select image from gallery it again opens the gallery ie the gallery is opening two times. </p>

<p>Don't know how to get rid of this.</p>

<p>Pls help urgent.</p>

<p>Thanks in advance.</p>

<p>here is my code:----</p>

<p>public class MyWebChromeClient extends WebChromeClient{
        public void openFileChooser(ValueCallback uploadMsg) {</p>

<pre><code>        mUploadMessage = uploadMsg;
        Intent i = new Intent(Intent.ACTION_GET_CONTENT);
        i.addCategory(Intent.CATEGORY_OPENABLE);
        i.setType("image/*");
        startActivityForResult(Intent.createChooser(i,"File Chooser"), FILECHOOSER_RESULTCODE);

    }

    public void openFileChooser( ValueCallback&lt;Uri&gt; uploadMsg, String acceptType ) {
        mUploadMessage = uploadMsg;
        Intent i = new Intent(Intent.ACTION_GET_CONTENT);
        i.addCategory(Intent.CATEGORY_OPENABLE);
        i.setType("*/*");
        startActivityForResult(
                Intent.createChooser(i, "File Browser"),
                FILECHOOSER_RESULTCODE);
    }
}
</code></pre>

<p>this is onactivityresult:---</p>

<p>protected void onActivityResult(int requestCode, int resultCode,
            Intent intent) {</p>

<pre><code>    if (requestCode == FILECHOOSER_RESULTCODE) {
        if (null == mUploadMessage)
            return;
        Uri result = intent == null || resultCode != RESULT_OK ? null
                : intent.getData();
        mUploadMessage.onReceiveValue(result);
        mUploadMessage = null;

    } 
}
</code></pre>
