Bitmap icon = BitmapFactory.decodeResource(context.getResources(),
R.drawable.icon_resource);
This is turning Drawable into a bitmap.
String name = c.getString(str_url);
URL url_value = new URL(name);
ImageView profile = (ImageView)v.findViewById(R.id.vdo_icon);
if (profile != null) {
Bitmap mIcon1 =
BitmapFactory.decodeStream(url_value.openConnection().getInputStream());
profile.setImageBitmap(mIcon1);
}
This is how to download an image from the web as a bitmap
© 2024 OneMinuteCode. All rights reserved.