Skip to content

Commit

Permalink
Mime type and extra path
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Oct 25, 2023
1 parent c99edd3 commit a77288d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1914,9 +1914,11 @@ public void requestFileEdit(final Context context, final File file) {
final Uri uri = FileProvider.getUriForFile(context, getFileProvider(context), file);
final Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setData(uri); // Mime type inferred automatically
intent.setType(GsFileUtils.getMimeType(file));
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
intent.putExtra(EXTRA_FILEPATH, file.getAbsolutePath());
startActivity(context, intent);
}

Expand Down

0 comments on commit a77288d

Please sign in to comment.