I saw this answer: What is the difference between Bitmap and Drawable in Android?
Can anyone give a practical explanation? When to use? Advantage disadvantage?
Bitmap is just an image as-is. Ideally it would be used to draw pixels on the screen with a Canvas, using a SurfaceView or something like that.
Drawable is a class that describes something that can be drawn on the screen.
BitmapDrawable is a subclass from Drawable. This means that it's a Drawable that wants to draw an image.
Usually android views work with Drawable objects, so any subclass of Drawable is acceptable, this means that if you want to use a Bitmap (raw pixels) on a View you need to create a BitmapDrawable and pass it to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With