You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
将这一行
Uri uri = getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
替换成
Uri uri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".fileProvider", fileImagePath);
同时在onActivityResult加入这样一行即可解决
ContentValues contentValues = new ContentValues(1);
contentValues.put(MediaStore.Images.Media.DATA, mImagePath);
getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
The text was updated successfully, but these errors were encountered:
将这一行
Uri uri = getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
替换成
Uri uri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".fileProvider", fileImagePath);
同时在onActivityResult加入这样一行即可解决
ContentValues contentValues = new ContentValues(1);
contentValues.put(MediaStore.Images.Media.DATA, mImagePath);
getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
The text was updated successfully, but these errors were encountered: