title: Android 9 (Pie) ContentResolver query MediaStore.Images.Media.EXTERNAL_CONTENT_URI returns null on api 28
body: <p>I am fetching list of all the images, videos and audio files in the device. The below code is working fine on all devices up till android O (api 27). But it is not working on android Pie devices (api 28). <code>Cursor</code>  returns null for the <code>query</code> </p>
  
  <p><strong>For Images</strong></p>
  
  <pre><code>String[] proj = {MediaStore.Images.Media._ID,
                      MediaStore.Images.Media.DATA,
                      MediaStore.Images.Media.TITLE,
                      MediaStore.Images.Media.SIZE
              };
  ContentResolver cr = context.getContentResolver();
  
  Cursor imagescursor = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
                      proj, null, null, "_size DESC");
  </code></pre>
  
  <p><strong>For Video files</strong> </p>
  
  <pre><code>String[] proj = {MediaStore.Video.Media._ID,
                      MediaStore.Video.Media.DATA,
                      MediaStore.Video.Media.TITLE,
                      MediaStore.Video.Media.SIZE,
                      MediaStore.Video.Media.DURATION
              };
  ContentResolver cr = context.getContentResolver();
  
  Cursor videocursor = context.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
                      proj, null, null, "_size DESC");
  </code></pre>
  
  <p><strong>For Audio files</strong></p>
  
  <pre><code>String[] proj = {MediaStore.Audio.Media._ID,
                      MediaStore.Audio.Media.DATA,
                      MediaStore.Audio.Media.DISPLAY_NAME,
                      MediaStore.Audio.Media.SIZE,
                      MediaStore.Audio.Media.DURATION};
  ContentResolver cr = context.getContentResolver();
  
  Cursor audiocursor = context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
                      proj, null, null, "_size DESC");
  </code></pre>
  
  <p>Please if anyone can help me out!</p>