What is the difference between setImageBitmap and setImageDrawable?
I have an image which I would like to set dynamically from file. The tu
Both methods are valid and achieve the same result. In the first method you wrap your bitmap around a drawable object which is an abstraction for anything that can be drawn in a View.
The special thing about Drawables is that they let you do all kinds of operations on the graphical object they wrap around (scaling, translation, opacity etc..).
A bitmap is one kind of drawable, you can learn further about drawables here: http://developer.android.com/guide/topics/resources/drawable-resource.html
In the second method, you directly access the bitmap bits without any drawable related operations and simply draw the bitmap as-is on your view.
Hope this helps, cheers, Max.