Here it says this
BitmapDrawable() This constructor was deprecated in API level 4. Use BitmapDrawable(android.content.res.Resources, android.graphics.Bitmap) instead to specify a bitmap to draw with and ensure the correct density is set.
I'm trying to set a temporary image Before an image is loaded. To get to this point I used this tutorial which gave me this function to get a color temporary instead of an image using this function :
static class DownloadedDrawable extends ColorDrawable {
private final WeakReference<BitmapDownloaderTask> bitmapDownloaderTaskReference;
public DownloadedDrawable(BitmapDownloaderTask bitmapDownloaderTask) {
super(Color.BLACK);
bitmapDownloaderTaskReference =
new WeakReference<BitmapDownloaderTask>(bitmapDownloaderTask);
}
public BitmapDownloaderTask getBitmapDownloaderTask() {
return bitmapDownloaderTaskReference.get();
}
}
I got to the idea to use the BitmapDrawable
by this question
If you know another way to do this I will of course be happy to use it but I prefer not to use a lib.