Issue
After upgrading my phone(Redmi 7a pie) to android 10 sometimes open with dialog appears when choosing a file with file chooser
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
if (intent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(Intent.createChooser(intent,null), 1);
}`
I have also tried with "ACTION_OPEN_DOCUMENT"
Do you have any idea how to fix this?
Edit: A solution from @Rinkal Patel with "ACTION_PICK" Very limited
Solution
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
if (intent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(Intent.createChooser(intent,null), 1);
}
Answered By - Rinkal Patel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.