title: Getting album art from the audio file Uri
body: <p>I am trying to get the album art from the audio file Uri, here is my code:</p>
  
  <pre><code>// uri is the audio file uri
  
  public static Bitmap getSongCoverArt(Context context, Uri uri){
      Bitmap songCoverArt = null;
      String[] projections = {MediaStore.Audio.Media.ALBUM_ID};
      Cursor cursor = null;
      try {
          cursor = context.getContentResolver().query(uri, projections, null, null, null);
          int column_index = cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM_ID);
          cursor.moveToFirst();
  
          Uri songCover = Uri.parse("content://media/external/audio/albumart");
          Uri uriSongCover = ContentUris.withAppendedId(songCover, column_index);
          Log.d(TAG, uriSongCover.toString());
          ContentResolver res = context.getContentResolver();
          try {
              InputStream in = res.openInputStream(uriSongCover);
              songCoverArt = BitmapFactory.decodeStream(in);
          }catch (FileNotFoundException e){
              Log.e(TAG, e.getMessage());
          }
      }finally {
          if(cursor != null){
              cursor.close();
          }
      }
  
      return songCoverArt;
  }
  </code></pre>
  
  <p>This function always returns "No entry for content://media/external/audio/albumart/0"</p>