mirror of
https://gitee.com/shuto/cordova-plugin-file-opener2.git
synced 2025-01-31 12:02:49 +08:00
Fixed a problem when opening APK files with Android SDK 25
This commit is contained in:
parent
764f5aed02
commit
639f1c46c4
@ -104,7 +104,7 @@ public class FileOpener2 extends CordovaPlugin {
|
|||||||
try {
|
try {
|
||||||
Uri path = Uri.fromFile(file);
|
Uri path = Uri.fromFile(file);
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
if((Build.VERSION.SDK_INT >= 23 && !contentType.equals("application/vnd.android.package-archive")) || (Build.VERSION.SDK_INT == 24 && contentType.equals("application/vnd.android.package-archive"))) {
|
if((Build.VERSION.SDK_INT >= 23 && !contentType.equals("application/vnd.android.package-archive")) || ((Build.VERSION.SDK_INT == 24 || Build.VERSION.SDK_INT == 25) && contentType.equals("application/vnd.android.package-archive"))) {
|
||||||
|
|
||||||
Context context = cordova.getActivity().getApplicationContext();
|
Context context = cordova.getActivity().getApplicationContext();
|
||||||
path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
|
path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
|
||||||
|
Loading…
Reference in New Issue
Block a user