Android致命异常:java.lang.UnsupportedOperationException:不支持删除

Android致命异常:java.lang.UnsupportedOperationException:不支持删除,android,Android,将我的代码更新到SDK 29后出现异常 java.lang.UnsupportedOperationException: Delete not supported at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtil

将我的代码更新到SDK 29后出现异常

java.lang.UnsupportedOperationException: Delete not supported
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
        at android.content.ContentProviderProxy.delete(ContentProviderNative.java:547)
        at android.content.ContentResolver.delete(ContentResolver.java:1691)
        at com.ashomok.cropimagelib.ScanFragment.getBitmap(ScanFragment.java:84)
当我打电话时

getActivity().getContentResolver().delete(uri, null, null);
另一个代码更新

@Override
public void startGalleryChooser() {
    if (Build.VERSION.SDK_INT < 19) {
        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_GET_CONTENT);
        intent.setType("image/*");
        startActivityForResult(Intent.createChooser(intent, getString(R.string.select_photo)),
                GALLERY_IMAGE_REQUEST);
    } else {
        Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
        intent.addCategory(Intent.CATEGORY_OPENABLE);
        intent.setType("image/*");
        startActivityForResult(Intent.createChooser(intent, getString(R.string.select_photo)),
                GALLERY_IMAGE_REQUEST);
    }
}

添加此权限也可以解决此问题吗?
Manifest.permission.MANAGE_DOCUMENTS