I am using the code below to download and show image from server to my ImageView
import java.io.IOException;
import java.io.InputStream;
import java.net.Http
I dont know it will be a solution for you or not
But you can use a Drawable
instead of Bitmap
Here is the code
void downloadFile(String fileUrl) {
try{
InputStream is = (InputStream) new URL(fileUrl).getContent();
Drawable d = Drawable.createFromStream(is, "src name");
imgView.setImageDrawable(d);
} catch (IOException e) {
e.printStackTrace();
}
}
This will show a png
correctly