Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get ImageView src programmatically

How to get ImageView src programmatically and set it in another ImageView

Drawable drawable = imageViewA....?
imageViewB.setImageDrawable(drawable);
like image 823
Sharonas Ykm Avatar asked Feb 04 '16 13:02

Sharonas Ykm


1 Answers

You can do something like this:

Drawable drawable = imageViewA.getDrawable();
if(drawable != null){
    imageViewB.setImageDrawable(drawable);
}
like image 112
camelCaseCoder Avatar answered Oct 24 '22 10:10

camelCaseCoder