fix: add Intent.FLAG_ACTIVITY_NEW_TASK flag

Add Intent.FLAG_ACTIVITY_NEW_TASK flag when opening a apk file.

fix #260
This commit is contained in:
Feng Yu 2019-06-01 12:24:12 +08:00 committed by GitHub
parent f7e1da9f14
commit 109fb4754c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,7 +114,7 @@ public class FileOpener2 extends CordovaPlugin {
path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
}
intent.setDataAndType(path, contentType);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NEW_TASK);
} else {
intent = new Intent(Intent.ACTION_VIEW);