I\'m trying to set drawable resource ID to android:src of ImageView using data binding
Here is my object:
public class Recipe implem
This work for me. i would have add it to @hqzxzwb answer as comment but due to reputation limitations.
I have this in my view Model
var passport = R.drawable.passport
Then in my xml, I have
android:src="@{context.getDrawable(model.passort)}"
And thats it