Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android display drawable in imageview

img=(ImageView)findViewById(R.id.imageview1);
Drawable myDrawable = getResources().getDrawable(R.drawable.imageView1);
img.setImageDrawable(myDrawable);
Comment

android imageview set image from drawable programmatically

In XML :
    android:background="@drawable/imagename 
    android:src="@drawable/imagename"
    
In Code :
	imageview.setImageResource(R.drawable.imagename);
Comment

PREVIOUS NEXT
Code Example
Java :: How to efficiently invert a binary tree, in Java? 
Java :: string to localdate in java 
Java :: how to use base64.getdecoder() android 
Java :: java parse xml string 
Java :: check last character of string java 
Java :: frequency of number in java using hashmap using getordefault 
Java :: assertthat code throws exception 
Java :: localdatetime to timestamp 
Java :: how to add a keylistener to a jframe 
Java :: java console colors 
Java :: firestore add to field array 
Java :: java int to binary 
Java :: datatypes in arduino 
Java :: java import set and hashset 
Java :: access main class from another class spigot 
Java :: how to set 2 decimal places in java 
Java :: keytool error: java.io.IOException: keystore password was incorrect java.io.IOException: keystore password was incorrect flutter 
Java :: Unhandled exception: java.lang.InterruptedException 
Java :: how to hide label in bottom menu android studio 
Java :: java read file bufferedreader 
Java :: android studio webview mailto 
Java :: java int to int array 
Java :: find object with same attribute java stream 
Java :: how to reset jframe java swing 
Java :: java random 5 digit int 
Java :: java string to path 
Java :: startactivityforresult deprecated android 
Java :: .now() java 
Java :: loop list java 
Java :: scanner check if int 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =