Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Android 11 下,拍照后图片无法进行裁剪 #188

Open
runla opened this issue Jul 9, 2021 · 0 comments
Open

Android 11 下,拍照后图片无法进行裁剪 #188

runla opened this issue Jul 9, 2021 · 0 comments

Comments

@runla
Copy link

runla commented Jul 9, 2021

ISCameraActivity 中的方法 getImageContentUri 中返回的 uri 有问题,建议换成如下代码:
`
public static Uri getFileUri(Context context,String path){
File photoFile = new File(path);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
//适配Android 7.0文件权限,通过FileProvider创建一个content类型的Uri
return FileProvider.getUriForFile(context,"包名.fileProvider", photoFile);
} else {
return Uri.fromFile(photoFile);
}
}

`

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant