skip to Main Content

Change the image of an ImageView by code in Android Studio

I'm trying to get an ImageView by code It's declared that way in my XML: <ImageView android:id="@+id/exo_image" android:layout_width="100dp" android:layout_height="100dp" android:src="@color/cardview_light_background"/> And I'm setting it by code that way: val bmp = BitmapFactory.decodeFile(mediaItem!!.mediaMetadata.artworkUri!!.path) view.setImageBitmap(null) if (bmp != null) { view.setImageBitmap(bmp) Log.d("TEMPS",…

VIEW QUESTION
Back To Top
Search