ImageView Transparency
<p>I have an issue on developing an app. I have a tabhost with multiple tabs. One of them, has 4 buttons which change some bitmap, but i want to these images are transparent. I trying multiple solutions but i can't solve it. When I set my imageview to transparent, change the image to black . I found multiple question  but  any solutions help me to solve it</p>

<p>main.xml</p>

<pre><code>&lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/backgroundtexture" &gt;

    &lt;RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" &gt;

        &lt;FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_below="@android:id/tabs" &gt;
        &lt;/FrameLayout&gt;

        &lt;TabWidget
            android:id="@android:id/tabs"
            style="test"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/tabwidget2"
            android:tabStripEnabled="false" /&gt;
    &lt;/RelativeLayout&gt;
&lt;/TabHost&gt;
</code></pre>

<p>Map.java tab</p>

<pre><code>Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.prueba_terraza_2048);       
iv.setImageBitmap(adjustOpacity(bm,0));


/**
 * @param bitmap The source bitmap.
 * @param opacity a value between 0 (completely transparent) and 255 (completely
 * opaque).
 * @return The opacity-adjusted bitmap.  If the source bitmap is mutable it will be
 * adjusted and returned, otherwise a new bitmap is created.
 */
private Bitmap adjustOpacity(Bitmap bitmap, int opacity){
Bitmap mutableBitmap = bitmap.isMutable()? bitmap : bitmap.copy(Bitmap.Config.ARGB_8888, true);
            Canvas canvas = new Canvas(mutableBitmap);
            int colour = (opacity &amp;amp; 0xFF) &amp;lt;&amp;lt; 24;
            canvas.drawColor(colour, PorterDuff.Mode.DST_IN);
            return mutableBitmap;
 }
</code></pre>

<p>adjustOpacity method from <a href="http://blog.uncommons.org/2011/01/12/adjusting-the-opacity-of-an-android-bitmap/" rel="nofollow">http://blog.uncommons.org/2011/01/12/adjusting-the-opacity-of-an-android-bitmap/</a></p>

<p>and map.xml (tab)</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" &gt;

    &lt;RelativeLayout&gt;
            ........... Buttons layer

    &lt;/RelativeLayout&gt;

    &lt;FrameLayout
        android:id="@+id/root"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/buttonlayer" &gt;

        &lt;ImageView
            android:id="@+id/imageView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:adjustViewBounds="true"
            android:background="@android:color/transparent"
            android:cacheColorHint="@android:color/transparent"
            android:contentDescription="@string/desc"
            android:scaleType="matrix" /&gt;
    &lt;/FrameLayout&gt;

&lt;/RelativeLayout&gt;
</code></pre>
