Closed tng10 closed 9 years ago
@tng10 not quite sure why you need the ressource id? we got no ressource id of the icon because those are generated during runtime.
I think you should read some more tutorials, this is the wrong place to ask beginners questions.
To give you a hint how to get started. The tutorial has following line:
holder.imgIcon.setImageResource(weather.icon);
Don't set the image by it's ressource. We got a drawable so you can set the image like this:
holder.imgIcon.setImage(weather.icon);
The class of weather.icon
will then be Drawable
instead of int
Cheers
Hey @mikepenz !
You're right, I've done like this and it works like a charm!
Thank you very much!
@tng10 you are welcome.
Hey guys
Is there a way to access icon's resource ID like we do using the code bellow?
I just want to put some icons in a navigation drawer. I'm using an adapter (http://goo.gl/RFzABb), so I need to do this with Java and not using XML.
Do you know if is possible to do that?