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.
This commit is contained in:
pawelzwronek 2020-05-04 18:54:28 +02:00 committed by GitHub
parent caa1d50793
commit 93dadbb6dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,7 +126,7 @@ public class FileOpener2 extends CordovaPlugin {
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);
}