Skip to content

Commit

Permalink
fix pickFiles with Android launchMode=singleInstance
Browse files Browse the repository at this point in the history
fix pickFiles for Android launchMode=singleInstance
  • Loading branch information
jay-k98 committed Feb 7, 2025
1 parent a74f892 commit 522ad1a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ private void startFileExplorer() {
if (type.equals("image/*")) {
intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
} else {
intent = new Intent(Intent.ACTION_GET_CONTENT);
if(Build.VERSION.SDK_INT >= 19) {
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
} else {
intent = new Intent(Intent.ACTION_GET_CONTENT);
}
intent.addCategory(Intent.CATEGORY_OPENABLE);
}
final Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + File.separator);
Expand Down

0 comments on commit 522ad1a

Please sign in to comment.