This is how i install a apk file:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Now i want to install a apk file from sdcard, i'm getting the uri through Storage Access Framework (From Kitkat), but code does not working.
Uri uri1 = Uri.fromFile(file); //file class File
Uri uri2 = df.getUri(); //df class DocumentFile
The code with uri1 works, but not with uri2
Any workaround? Thanks