readded check for opening apk files with SDK 24

This commit is contained in:
pwlin 2017-05-30 12:23:38 +02:00
parent ac5ba3ffb3
commit f99d47fce9

View File

@ -104,7 +104,7 @@ public class FileOpener2 extends CordovaPlugin {
try {
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
if(Build.VERSION.SDK_INT >= 23 && !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 && contentType.equals("application/vnd.android.package-archive"))) {
Context context = cordova.getActivity().getApplicationContext();
path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);