Closed
Description
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); String packageName = context.getPackageName(); Uri uri = FileProvider.getUriForFile(context, packageName + ".fileProvider", new File(filePath)); intent.setDataAndType(uri, typeString); } else { intent.setDataAndType(Uri.fromFile(file), typeString); }
修改 Build.VERSION.SDK_INT > Build.VERSION_CODES.M
Metadata
Assignees
Labels
No labels