title: Android MediaSession not displaying album art as lockscreen background
body: <p>After loading in all the current song information to the session metadata, the album art refuses to load on the lockscreen. I know for a fact that the bitmap is valid because I use the same resource for the notification art. I've also tried using just a static resource, but no luck. Any help would be much appreciated.</p>
  
  <pre><code>        String more;
      if (shuffled) {
          more = Integer.toString(shufflePosition+1) + "/" + Integer.toString(playlist.size());
      }
      else{
          more = Integer.toString(position+1) + "/" + Integer.toString(playlist.size());
      }
  
      int notificationAction = android.R.drawable.ic_media_pause;//needs to be initialized
  
      //Build a new notification according to the current state of the MediaPlayer
      if (mp.isPlaying()) {
          notificationAction = android.R.drawable.ic_media_pause;
      } else{
          notificationAction = android.R.drawable.ic_media_play;
      }
  
      Bitmap bitmap = null;
      try {
          bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(),np.getArt());
      } catch (IOException e) {
          bitmap = BitmapFactory.decodeResource(getResources(),
                  R.mipmap.empty_track);
          e.printStackTrace();
      }
  
      mSession.setMetadata(new MediaMetadataCompat.Builder()
              .putBitmap(MediaMetadata.METADATA_KEY_ART, bitmap)
              .putString(MediaMetadata.METADATA_KEY_ARTIST, np.getArtist())
              .putString(MediaMetadata.METADATA_KEY_ALBUM, np.getAlbum())
              .putString(MediaMetadata.METADATA_KEY_TITLE, np.getTrack())
              .build());
  
      Notification notification;
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
          notification = new android.support.v7.app.NotificationCompat.Builder(this)
                  .setVisibility(Notification.VISIBILITY_PUBLIC)
                  .setSmallIcon(R.mipmap.empty_artist)
                  .setShowWhen(false)
                  .addAction(new NotificationCompat.Action.Builder(android.R.drawable.ic_media_previous, "Previous", pendingPrev).build())
                  .addAction(new NotificationCompat.Action.Builder(notificationAction, "Pause", pendingPlay).build())
                  .addAction(new NotificationCompat.Action.Builder(android.R.drawable.ic_media_next, "Next", pendingNext).build())
                  .setColor(getResources().getColor(R.color.colorPrimary))
                  .setContentTitle(np.getTrack())
                  .setContentText(np.getArtist())
                  .setSubText(more)
                  .setPriority(Notification.PRIORITY_MAX)
                  .setLargeIcon(bitmap)
                  .setContentIntent(launchActivity)
                  .setStyle(new android.support.v7.app.NotificationCompat.MediaStyle()
                          .setMediaSession(mSession.getSessionToken()).setShowActionsInCompactView(0,1,2))
                  .build();
      } else {
          notification = new android.support.v7.app.NotificationCompat.Builder(this)
                  .setVisibility(Notification.VISIBILITY_PUBLIC)
                  .setSmallIcon(R.mipmap.empty_artist)
                  .setShowWhen(false)
                  .addAction(new NotificationCompat.Action.Builder(android.R.drawable.ic_media_previous, "Previous", pendingPrev).build())
                  .addAction(new NotificationCompat.Action.Builder(notificationAction, "Pause", pendingPlay).build())
                  .addAction(new NotificationCompat.Action.Builder(android.R.drawable.ic_media_next, "Next", pendingNext).build())
                  .setColor(getResources().getColor(R.color.colorPrimary))
                  .setContentTitle(np.getTrack())
                  .setContentText(np.getArtist())
                  .setSubText(more)
                  .setPriority(Notification.PRIORITY_MAX)
                  .setLargeIcon(bitmap)
                  .setContentIntent(launchActivity)
                  .setStyle(new android.support.v7.app.NotificationCompat.MediaStyle()
                          .setMediaSession(mSession.getSessionToken())
                          .setShowActionsInCompactView(0,1,2))
                  .build();
      }
      NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
      notificationManager.notify(001, notification);
      startForeground(001, notification);
  </code></pre>