Uploaded PNG image with transparent background shows with black background.

In my Android application, I downloaded several png images and recorded them on an SD card. when I show them as an image, they are displayed with a black background. source images have a transparent background. How can I keep the background transparent. Please help me. I use PNG format for compressing and writing to an SD card.

+7
android image bitmap imageview bitmapimage
source share
1 answer

Set the background view as

R.color.transparent 

or in xml for example

 android:background="@android:color/transparent" 

Edited by:

Thanks for the answer. Yes, I did it. I have done it now. One more thing, I set the color to android.R.color.transparent canvas and it worked

+4
source share

All Articles