简体   繁体   中英

Changing image in imageview dynamically

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM