Skip to content

Commit ba850bf

Browse files
committed
chore: allow only local files for picking
1 parent 7890db2 commit ba850bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/imagepicker.android.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ export class ImagePicker {
196196
intent.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
197197
}
198198

199-
intent.setAction(Intent.ACTION_GET_CONTENT);
199+
intent.putExtra(android.content.Intent.EXTRA_LOCAL_ONLY, true);
200+
intent.putExtra(android.content.Intent.CATEGORY_OPENABLE, true);
201+
intent.setData(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
202+
intent.setAction(android.content.Intent.ACTION_PICK);
203+
200204

201205
let chooser = Intent.createChooser(intent, "Select Picture");
202206
application.android.foregroundActivity.startActivityForResult(intent, RESULT_CODE_PICKER_IMAGES);

0 commit comments

Comments
 (0)