I have an image from the Internet in ImageView . It is very small (icon) and I would like to save it in my SQLite database. I can get Drawable from mImageView.getDrawable() , but then I don't know what to do next. I do not quite understand the Drawable class in Android.
I know that I can get an array of bytes from Bitmap , for example:
Bitmap defaultIcon = BitmapFactory.decodeStream(in); ByteArrayOutputStream stream = new ByteArrayOutputStream(); defaultIcon.compress(Bitmap.CompressFormat.JPEG, 100, stream); byte[] bitmapdata = stream.toByteArray();
But how to get an array of bytes from Drawable ?
android database drawable android-bitmap
David Shellabarger Dec 14 '10 at 4:14 2010-12-14 04:14
source share