title: creating file from uri in android 11 - getPath() not working
body: <p>I want to create a file from uri in the ActivityResultCallback in android 11. I use <code>uri.getPath()</code> to convert the incoming uri to a file. but, it won't work in android 11. here is my codes:</p>
  <pre><code>       private void launchGallery (){
              Intent intent = new Intent(Intent.ACTION_PICK,
                      android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
              launcherGallery.launch(intent);
          }
      
          ActivityResultLauncher&lt;Intent&gt; launcherGallery = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
                  result -&gt; {
                      if (result.getResultCode() == RESULT_OK) {
                          Intent data = result.getData();
                          if (data != null) {
                              Uri imageUri = data.getData();
                              // ---&gt; getPath() won't work in android 11 &lt;---
                              File file = new File(imageUri.getPath());
                              // I don't want to display the image in an ImageView. 
                              // I need a file object to pass it to this method to encrypt it
                              encryptImage(file);
                              
                          }
                      }
                  });
  </code></pre>
  <p><b>so, how can I create a file from uri in android 11?</b></p>