title: Google Maps Cluster Item Marker Icon with Picasso
body: <p>I'm using Google Map SDK 7.3.0 with android-maps-utils 0.3.4 because I need clusters for my Markers on the map. </p>
  
  <p><img src="https://i.stack.imgur.com/X9eIT.jpg" alt="My map"></p>
  
  <p>Ok, so here the problem is, I shouldn't have a red marker. Only green+blue markers. 
  I subclassed <code>DefaultClusterRenderer</code> to create my custom marker view but sometimes it just doesn't work. </p>
  
  <p>I'm using picasso to get the green icon because it's coming from an API. But the problem is, when picasso has loaded the bitmap it's too late, the icon has already been set to the default one (red).</p>
  
  <p>Here's my onBeforeClusterItemRenderer :</p>
  
  <pre><code>            Picasso.with(getApplicationContext()).load(item.url).into(new Target() {
              @Override
              public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
                  FrameLayout icon = (FrameLayout) LayoutInflater.from(getApplicationContext()).inflate(R.layout.marker, null);
                  if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.JELLY_BEAN) {
                      icon.findViewById(R.id.bg).setBackground(new BitmapDrawable(getResources(), bitmap));
                  } else {
                      icon.findViewById(R.id.bg).setBackgroundDrawable(new BitmapDrawable(getResources(), bitmap));
                  }
  
  
                  Bitmap b = createDrawableFromView(Home.this, icon);
  
                  if (marker != null) {
                      marker.icon(BitmapDescriptorFactory.fromBitmap(b));
                  }
              }
  
              @Override
              public void onBitmapFailed(Drawable errorDrawable) {
  
              }
  
              @Override
              public void onPrepareLoad(Drawable placeHolderDrawable) {
  
              }
          });
  </code></pre>