set ImageView Resource - Android User Interface

Android examples for User Interface:ImageView

Description

set ImageView Resource

Demo Code


import android.databinding.BindingAdapter;
import android.widget.ImageView;

public class Main{
    @BindingAdapter({ "app:srcCompat" })
    public static void setImageViewResource(ImageView imageView,
            int resource) {
        imageView.setImageResource(resource);
    }/*from  w ww .j  av  a2  s .  c  o m*/
}

Related Tutorials