Skip to content

Commit

Permalink
fix(android): DocumentPicker throw error [Error: User canceled docume…
Browse files Browse the repository at this point in the history
…nt 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.
  • Loading branch information
GaryOoi authored Feb 28, 2023
1 parent 7647325 commit ac70c24
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void pick(ReadableMap args, Promise promise) {
boolean multiple = !args.isNull(OPTION_MULTIPLE) && args.getBoolean(OPTION_MULTIPLE);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiple);

currentActivity.startActivityForResult(Intent.createChooser(intent, null), READ_REQUEST_CODE, Bundle.EMPTY);
currentActivity.startActivityForResult(intent, READ_REQUEST_CODE, Bundle.EMPTY);
} catch (ActivityNotFoundException e) {
sendError(E_UNABLE_TO_OPEN_FILE_TYPE, e.getLocalizedMessage());
} catch (Exception e) {
Expand Down

0 comments on commit ac70c24

Please sign in to comment.