Merge pull request #111 from lp1bp/master

Fix APK Install on Android 23
This commit is contained in:
pwlin 2017-04-19 14:36:08 +02:00 committed by GitHub
commit 95dc8dcb46

View File

@ -98,7 +98,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){
if(Build.VERSION.SDK_INT >= 23 && !contentType.equals("application/vnd.android.package-archive")){
Context context = cordova.getActivity().getApplicationContext();
path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);