How to convert a string like "R.drawable.online" into a path, which can represent an image? What should I do for this?
Asked
Active
Viewed 1,098 times
2 Answers
0
Take a look at this answer:
Android and getting a view with id cast as a string
By the way... that kind of resources cannot be access using a path... you must use the integer representation of it.
0
if you have an image inside your folder /drawable/online.png you will load your image for example into a ImageView...
ImageView.setImageDrawable(getResources().getDrawable(R.drawable.online));

Jorgesys
- 124,308
- 23
- 334
- 268