Skip to content

Commit ac70c24

Browse files
authored
fix(android): DocumentPicker throw error [Error: User canceled document picker] (#630)
Fix Error: User canceled document picker Issue with many different devices (Motorola G7, Huawei P30 Pro, Samsung Galaxy Note 9, Huawei P30...). All users with the problem have Android 10.0, but not all users with android 10 have this issue.
1 parent 7647325 commit ac70c24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/src/main/java/com/reactnativedocumentpicker/DocumentPickerModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void pick(ReadableMap args, Promise promise) {
141141
boolean multiple = !args.isNull(OPTION_MULTIPLE) && args.getBoolean(OPTION_MULTIPLE);
142142
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiple);
143143

144-
currentActivity.startActivityForResult(Intent.createChooser(intent, null), READ_REQUEST_CODE, Bundle.EMPTY);
144+
currentActivity.startActivityForResult(intent, READ_REQUEST_CODE, Bundle.EMPTY);
145145
} catch (ActivityNotFoundException e) {
146146
sendError(E_UNABLE_TO_OPEN_FILE_TYPE, e.getLocalizedMessage());
147147
} catch (Exception e) {

0 commit comments

Comments
 (0)