Android: Getting references to Drawable images

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:


(I share little code snippets out here like this because I can never remember how to do some of these things.)