I have a project that I have to create an array of coins and work with it. My GUI looks like this: http://i.imgur.com/eRzN3Sb.png
I want to be able to load the corresponding image from coinArray for each coin. basically, I want to say that coinView.setBackgroundResource (coinArray [x] .image) I suppose I need to use a drawing object in some way, and I was hoping it could be included in my enum class. the enum class looks like
public enum Currency { Penny(1), Nickel(5), Dime(10), Quarter(25); private int value; private Currency(int value) { this.value = value; } }
Each coin in the array has a currency value, so I can calculate them. I would like to add an attractive or some other object that will allow me to convey the correct image for each coin.
thanks
android enums drawable
Shmuel
source share