9
0
mirror of https://gitee.com/shuto/cordova-plugin-file-opener2.git synced 2025-02-23 05:42:50 +08:00

Merge pull request from rastafan/master

Grant Write permission in android intent
This commit is contained in:
Aaron Faber 2019-04-15 15:04:33 +01:00 committed by GitHub
commit f7e1da9f14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,7 +121,7 @@ public class FileOpener2 extends CordovaPlugin {
Context context = cordova.getActivity().getApplicationContext();
Uri path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
intent.setDataAndType(path, contentType);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_ACTIVITY_NO_HISTORY);
}