public static void setImage(ImageView view, int resourceId) { view.setImageDrawable(view.getContext().getDrawable(resourceId)); } Pikachu.java public int imageResource = R.drawable.sprite_25;
binding • Official documentation https://developer.android.com/topic/libraries/data- binding/index.html • “Data Binding Techniques” by Jacob Tabak’s (video from Droidcon NYC 2015) https://www.youtube.com/watch?v=WdUbXWztKNY • “Marshmallow Brings Data Bindings to Android” by Yiğit Boyar and George Mount (video and transcription from Bay Area Android Dev Group, Oct. 2015) https://realm.io/news/data-binding-android-boyar-mount/ • “Advanced Data Binding” by Yiğit Boyar (video from Google I/O 2016) https: //www.youtube.com/watch?v=DAmMN7m3wLU