title: Android fatal exception: java.lang.UnsupportedOperationException: Delete not supported
body: <p>Exception after the update my code to SDK 29. </p>
  
  <pre><code>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)
  </code></pre>
  
  <p>When I call </p>
  
  <pre><code>getActivity().getContentResolver().delete(uri, null, null);
  </code></pre>
  
  <p>another code update</p>
  
  <pre><code>@Override
  public void startGalleryChooser() {
      if (Build.VERSION.SDK_INT &lt; 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);
      }
  }
  </code></pre>
  
  <p>How can I deal with this exception with backward code compatibility?</p>
  
  <p>I have permission granted:</p>
  
  <pre><code>Manifest.permission.MANAGE_DOCUMENTS
  </code></pre>