title: How can i list all files created by my app in API 29+ scoped storage?
body: <p>I want to log files and directories created by my android app on above API level 29+,
  since <code>listFiles()</code> not working and giving <code>null</code> output.
  following code creates TestFolder and copies image into it, I want to read all images from it.</p>
  <pre><code>ContentResolver resolver = getContentResolver();
      ContentValues contentValues = new ContentValues();
      String RELATIVE_PATH = Environment.DIRECTORY_PICTURES + File.separator + &quot;TestFolder&quot;;
  
      try{
  
          contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, System.currentTimeMillis()+&quot;.jpg&quot;);
          contentValues.put(MediaStore.MediaColumns.MIME_TYPE, &quot;image/jpg&quot;);
          OutputStream imageOutStream;
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.Q) {
              contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, RELATIVE_PATH);
          }
  
          Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), imageUri);
          Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
  
          imageOutStream = resolver.openOutputStream(uri);
          bitmap.compress(Bitmap.CompressFormat.JPEG, 100, imageOutStream);
          imageOutStream.close();
  
          destTv.setText(uri.toString());
  
      }catch (Exception e){
          Log.e(TAG, &quot;init: &quot;+e );
      }
  </code></pre>