title: How to i get image from gallery in android Q?
body: <p>In my code i use MediaStore.Images.Media.DATA for getting image location but in Android Q its getting deprecated could you please suggest some example or solution of this issue. thanks </p>
  
  <pre><code>   final String[] columns = {MediaStore.Images.Media.DATA, MediaStore.Images.Media._ID,
                          MediaStore.Images.ImageColumns.ORIENTATION};
                  final String orderBy = MediaStore.Images.Media.DATE_TAKEN;
           Cursor imageCursor = getActivity().getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, columns, null, null, orderBy + " DESC" );
                  while (imageCursor.moveToNext()) {
                      Uri uri = Uri.parse(imageCursor.getString(imageCursor.getColumnIndex(MediaStore.Images.Media.DATA)));
  
                    /*  Uri uri = ContentUris.withAppendedId(
                              MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
                              imageCursor.getLong(Integer.parseInt(BaseColumns._ID)));*/
  
                      Uri uris = Uri.parse("file://" + uri);
                      if(!new File(uris.getPath()).exists() || uris.toString().contains(".gif") || uris.toString().contains(".GIF"))
                          continue;
                      mediaList.add(new ExternalMediaFileBean(uris,false));
  
      //            }
   imageCursor.close();
              }
  </code></pre>