[
https://issues.apache.org/jira/browse/CB-9148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15980192#comment-15980192
]
Julio Diniz Perdigão commented on CB-9148:
------------------------------------------
Hi guys!
I don't know if it's a bug... but for Android 3.0+ and 4.1+, the intent setType
was not set... so, because this, I was getting the error "no application can
perform this action."
Adding the content.setType("*/*"); (Same as Android 5.0+)... fixed for me.
Hope this help anyone!
// For Android 4.1+
public void openFileChooser(ValueCallback<Uri> uploadMsg,
String acceptType, String capture)
{
LOG.d(LOG_TAG, "File Chooser 4.1+");
// Call file chooser for Android 3.0+
openFileChooser(uploadMsg, acceptType);
}
// For Android 3.0+
public void openFileChooser(ValueCallback<Uri> uploadMsg,
String acceptType)
{
LOG.d(LOG_TAG, "File Chooser 3.0+");
mUploadCallback = uploadMsg;
Intent content = new Intent(Intent.ACTION_GET_CONTENT);
content.addCategory(Intent.CATEGORY_OPENABLE);
content.setType("*/*");
// run startActivityForResult
cordova.startActivityForResult(InAppBrowser.this,
Intent.createChooser(content, "Select File"), FILECHOOSER_REQUESTCODE);
}
> Add support for file picker in InAppBrowser
> -------------------------------------------
>
> Key: CB-9148
> URL: https://issues.apache.org/jira/browse/CB-9148
> Project: Apache Cordova
> Issue Type: Improvement
> Components: Plugin InAppBrowser
> Affects Versions: 3.5.0, 3.6.0
> Environment: problem in Android, the camera roll never opens (iOS
> working OK)
> Reporter: Tomas Rawski
> Labels: Android, camera, file, input, roll, triaged
>
> reproduce :
> open the inAppBrowser: http://www.plupload.com/examples
> click in Add files.
> This works ok when I call it from the _system or _self. But not for _blank.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]