I want to find the file path to an image stored in res/drawable/
in a format that is easy to parse. For example, drawable://2131099733
is bad to parse, but /drawable/1.jpg
is easy. What I've tried below doesn't work, but that would be the ideal way to do it.
The reason why I want it is because I will have images that are named things like 1.jpg
and 2.jpg
, then I will be able to use string concatenation to easily load it into an ImageView
.
File imgFile = new File("/res/drawable/adorable-animal-cat-20787.jpg");