Skip to content

Commit

Permalink
fix(android): Open file with mime
Browse files Browse the repository at this point in the history
  • Loading branch information
dragermrb committed May 20, 2022
1 parent f8b06e2 commit f073a81
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public void open(PluginCall call) {

Intent openFileIntent = new Intent(Intent.ACTION_VIEW);

openFileIntent.setDataAndNormalize(fileUri);

if (mime != null && !mime.trim().equals("")) {
openFileIntent.setTypeAndNormalize(mime);
if (mime == null || mime.trim().equals("")) {
openFileIntent.setDataAndNormalize(fileUri);
} else {
openFileIntent.setDataAndTypeAndNormalize(fileUri, mime);
}

openFileIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
Expand Down

0 comments on commit f073a81

Please sign in to comment.