From 93dadbb6dc627794abc44d4545f992b17c5bf61a Mon Sep 17 00:00:00 2001 From: pawelzwronek Date: Mon, 4 May 2020 18:54:28 +0200 Subject: [PATCH] Fix for unable to print opened file By not setting FLAG_ACTIVITY_NO_HISTORY flag, android doesn't remove the intend of opened file from memory when trying to print the file so printing is working now. --- .../github/pwlin/cordova/plugins/fileopener2/FileOpener2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java b/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java index 82e88778..3f2182d2 100644 --- a/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java +++ b/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java @@ -126,7 +126,7 @@ private void _open(String fileArg, String contentType, Boolean openWithDefault, Context context = cordova.getActivity().getApplicationContext(); Uri path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".provider", file); 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); }