title: changing the background to match the color of album art
body: <p>I am working on a Music Player for android and i wanted help on making the background color the same as the album art of the playing song kind of like Sony Walkman.
  I tried following code but its not working.<br>
  Can someone guide or help me on how to make it work ?</p>
  
  <pre><code> public void updatePlayerBar(Bitmap bitmap) {
          Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
              public void onGenerated(Palette palette) {
                  Palette.Swatch swatch = palette.getVibrantSwatch();
                  if (swatch == null) swatch = palette.getMutedSwatch(); // Sometimes vibrant swatch is not available
                  if (swatch != null) {
  
                      album_art.setBackgroundColor(swatch.getRgb());   
                      album.setTextColor(swatch.getTitleTextColor());   
                      artist.setTextColor(swatch.getBodyTextColor());
                  }
              }
          });
      }
  
   public void acv(String path) {   //method for retrieving album art
  
          metaRetriver = new MediaMetadataRetriever();
          metaRetriver.setDataSource(path);
          try {
              art = metaRetriver.getEmbeddedPicture();
              Bitmap songImage = BitmapFactory.decodeByteArray(art, 0, art.length);
              album_art.setImageBitmap(songImage);
  
  
     album.setText(metaRetriver
                  .extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM));
          artist.setText(metaRetriver
                  .extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST));
  
  
              updatePlayerBar(songImage);   //calling method updatePlayerBar here 
          } catch (Exception e) {
              album.setText("Unknown Album");
              artist.setText("Unknown Artist");
          }
  
      }
  </code></pre>