8

What is the different between them?

where and why we need to convert from one type to another?

hippietrail
  • 15,848
  • 18
  • 99
  • 158
thalsharif
  • 357
  • 2
  • 6
  • 18

2 Answers2

1

For a difference between bitmap and drawable see here

ImageView is something like img tag in HTML. It is the View that displays an image.

Community
  • 1
  • 1
antoniom
  • 3,143
  • 1
  • 37
  • 53
0

Bitmap actually refers to the Images like png, jpg, etc.

ImageView is a view that is used to display an image. You can call

imageView.setImageBitmap(your_bitmap) // displays your bitmap 
imageView.setImageDrawable(your_drawable) // displays your drawable
imageView.setImageResource(R.drawable.your_drawable_file) // displays drawable from resource
imageView.setImageURI(Uri_here) // displays from Uri

Drawable is something that can be drawn like layout, vector, image, etc.

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440