1

I have an enum and I want to display resource strings depending on what the enum value is. I've already looked at this question, but those answers wont work in my case because the enum I'm using is from a framework, so I can't modify the enum and can't control when the enum changes.

Right now I'm just using an EnumMap to map the enums to the resource strings, but there are like 40 possible enum values so this map is quite large. Does Android not have any standard way to do this?

Matt
  • 2,232
  • 8
  • 35
  • 64
  • 1
    I think android made the EnumMap to make it easier to map enums to some values especially if the mapped values are changing. If you do not like it this way, you can name your resources in away that look like enum. Resource values are integers anyway. – alsaleem Apr 26 '19 at 14:51

0 Answers0