title: Android Google Map IconGenerator - Making a transparent marker icon
body: <p>So I'm using a <code>ClusterManager</code>to cluster my <code>Markers</code>, so that the user can have a better experience.</p>
  
  <p>I have actually implemente Google's code, which I found <a href="https://developers.google.com/maps/documentation/android/utility/marker-clustering" rel="noreferrer">here</a>. Imagine now that my <code>Marker</code> icon is a ball. I want the background of the icon to be transparent, not white.</p>
  
  <p>On Google's original tutorial they set a <code>ImageView</code> to the <code>IconGenerator</code>, like this:</p>
  
  <pre><code>public class MyClusterManagerRenderer extends DefaultClusterRenderer&lt;ClusteredMarker&gt; {
  
  private final IconGenerator mIconGenerator;
  private final ImageView mImageView;
  
  public MyClusterManagerRenderer(Context context, GoogleMap googleMap,
                                  ClusterManager&lt;ClusteredMarker&gt; clusterManager){
  
      super(context, googleMap, clusterManager);
  
      mIconGenerator = new IconGenerator(context);
      mImageView = new ImageView(context);
      mIconGenerator.setContentView(mImageView);
  }
  
  @Override
  protected void onBeforeClusterItemRendered(ClusteredMarker item, MarkerOptions markerOptions) {
  
      mImageView.setImageResource(item.iconPicture);
      Bitmap icon = mIconGenerator.makeIcon();
      markerOptions.icon(BitmapDescriptorFactory.fromBitmap(icon)).title(item.user);
  }
  
  ...
  }
  </code></pre>
  
  <p>I have tried several ways to make my icon transparent, like calling:</p>
  
  <blockquote>
    <p>mImageView.setBackgroundColor(Color.TRANSPARENT);</p>
  </blockquote>
  
  <p>but without success. The only way I managed to find a solution is to directly attach my transparent image to the <code>IconGenerator</code>, like this:</p>
  
  <blockquote>
    <p>mIconGenerator.setBackground(aContext.getResources().getDrawable(R.drawable.ball));</p>
  </blockquote>
  
  <p>The downside of this approach is that a <code>ImageView</code> have some interesting methods that I would like to call, like <code>setPadding</code>, while the <code>IconGenerator</code> doesn't have that.</p>
  
  <p>So, is there a way to make my icon transparent, using the <code>ImageView</code>?</p>
  
  <p>Thank you,</p>