Answers for "how to set image to imageview in android programmatically from drawable"

1

android display drawable in imageview

img=(ImageView)findViewById(R.id.imageview1);
Drawable myDrawable = getResources().getDrawable(R.drawable.imageView1);
img.setImageDrawable(myDrawable);
Posted by: Guest on April-07-2021
1

android imageview set image from drawable programmatically

In XML :
    android:background="@drawable/imagename 
    android:src="@drawable/imagename"
    
In Code :
	imageview.setImageResource(R.drawable.imagename);
Posted by: Guest on November-06-2021

Code answers related to "how to set image to imageview in android programmatically from drawable"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language