mirror of
https://gitee.com/shuto/cordova-plugin-file-opener2.git
synced 2025-01-31 12:02:49 +08:00
Fix opening files when targeting android SDK 28
This commit is contained in:
parent
a29cea0750
commit
ca406994ef
@ -119,7 +119,7 @@ public class FileOpener2 extends CordovaPlugin {
|
|||||||
} else {
|
} else {
|
||||||
intent = new Intent(Intent.ACTION_VIEW);
|
intent = new Intent(Intent.ACTION_VIEW);
|
||||||
Context context = cordova.getActivity().getApplicationContext();
|
Context context = cordova.getActivity().getApplicationContext();
|
||||||
Uri path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
|
Uri path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".provider", file);
|
||||||
intent.setDataAndType(path, contentType);
|
intent.setDataAndType(path, contentType);
|
||||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user