We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.0以上的系统没问题,4.0的系统上,报上述错误; GalleryPickActivity.java的showCameraAction()函数,修改一下: private void showCameraAction() { // 跳转到系统照相机 Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (cameraIntent.resolveActivity(mActivity.getPackageManager()) != null) { // 设置系统相机拍照后的输出路径 // 创建临时文件 cameraTempFile = FileUtils.createTmpFile(mActivity, galleryConfig.getFilePath()); Uri imageUri = FileProvider.getUriForFile(mContext, "com.yancy.gallerypick.fileprovider", cameraTempFile); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
List<ResolveInfo> resInfoList = mContext.getPackageManager().queryIntentActivities(cameraIntent, PackageManager.MATCH_DEFAULT_ONLY); for (ResolveInfo resolveInfo : resInfoList) { String packageName = resolveInfo.activityInfo.packageName; mContext.grantUriPermission(packageName, imageUri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); } startActivityForResult(cameraIntent, REQUEST_CAMERA); } else { Toast.makeText(mContext, R.string.gallery_msg_no_camera, Toast.LENGTH_SHORT).show(); galleryConfig.getIHandlerCallBack().onError(); } }
The text was updated successfully, but these errors were encountered:
感谢反馈,,, 已经修改此bug 稍作整理 会发布下个版本
Sorry, something went wrong.
No branches or pull requests
5.0以上的系统没问题,4.0的系统上,报上述错误;
GalleryPickActivity.java的showCameraAction()函数,修改一下:
private void showCameraAction() {
// 跳转到系统照相机
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (cameraIntent.resolveActivity(mActivity.getPackageManager()) != null) {
// 设置系统相机拍照后的输出路径
// 创建临时文件
cameraTempFile = FileUtils.createTmpFile(mActivity, galleryConfig.getFilePath());
Uri imageUri = FileProvider.getUriForFile(mContext, "com.yancy.gallerypick.fileprovider", cameraTempFile);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
The text was updated successfully, but these errors were encountered: