I have a "detailed" view of some products and when the user taps one of the rows in the listview a detailed view of the product is showed. How do I change the image in the imageview when I have the name of the image file which is in the Drawable folder?
Thank you.
asked Mar 16, 2011 at 9:07
user626912
2,5603 gold badges24 silver badges34 bronze badges
-
Please tell what's your problem. You cant't find a proper control's method or can't transform file name to name of field in R file?Alexander Oleynikov– Alexander Oleynikov2011年03月16日 09:11:28 +00:00Commented Mar 16, 2011 at 9:11
-
I want to get a resource(image) in the drawable folder from a filename(string)user626912– user6269122011年03月16日 09:28:22 +00:00Commented Mar 16, 2011 at 9:28
1 Answer 1
Maybe using assets is more suitable solution for you? This topic was already discussed. Otherwise you can use reflection to find a needed field in R class.
answered Mar 16, 2011 at 9:36
Alexander Oleynikov
19.4k12 gold badges40 silver badges51 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default