I have an image res/drawable/test.png (R.drawable.test). I want to pass this image to a function which accepts Drawable, e.g. mButton.set
res/drawable/test.png
Drawable
mButton.set
If you are inheriting from a fragment you can do:
Drawable drawable = getActivity().getDrawable(R.drawable.icon)