forked from github/cordova-android
Accept multiple mime types on file input (#971)
This commit is contained in:
parent
d5d448888d
commit
d90e191837
@ -220,6 +220,13 @@ public class SystemWebChromeClient extends WebChromeClient {
|
|||||||
}
|
}
|
||||||
Intent intent = fileChooserParams.createIntent();
|
Intent intent = fileChooserParams.createIntent();
|
||||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, selectMultiple);
|
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, selectMultiple);
|
||||||
|
|
||||||
|
// Uses Intent.EXTRA_MIME_TYPES to pass multiple mime types.
|
||||||
|
String[] acceptTypes = fileChooserParams.getAcceptTypes();
|
||||||
|
if (acceptTypes.length > 1) {
|
||||||
|
intent.setType("*/*"); // Accept all, filter mime types by Intent.EXTRA_MIME_TYPES.
|
||||||
|
intent.putExtra(Intent.EXTRA_MIME_TYPES, acceptTypes);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
parentEngine.cordova.startActivityForResult(new CordovaPlugin() {
|
parentEngine.cordova.startActivityForResult(new CordovaPlugin() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user