By Alvin Alexander. Last updated: March 11, 2019
As two quick Android “drawable” notes, if you want to convert a drawable resource into a Drawable
reference, you can use code like this:
Drawable myImage = getResources().getDrawable(R.drawable.myImage);
Second, if you want to display a drawable image resource on an ImageView
, you can use code like this:
imageView.setImageResource(R.drawable.myImage);
(I share little code snippets out here like this because I can never remember how to do some of these things.)