I'm trying to iterate over an enum but I cannot access any values they were set with. Android Studio only sees the name and ordinal, but nothing else.
I'm not sure if this is an android studio problem as other online tutorials for kotlin enums seem to do what I do and work just fine.
enum class TimeStamps(value : Long, text : String) {
Hour(0, "Past Hour"),
Day(3600000, "Today"),
Yesterday(86400000, "Yesterday"),
Week(172800000, "This week"),
LastWeek(604800000, "Last week"),
LastMonth(1209600000, "Last month"),
LastYear(2628000000, "Last year"),
LongTime(31540000000, "A long time ago")
}
TimeStamps.LastMonth.value
TimeStamps.LastMonth.text //Both of these are said to be undefined by Android Studio
enumValues<TimeStamps>().forEach {
it.value //Also undefined
}
I'm not exactly sure what is going on. The only error message I get is the Unresolved Reference error. Any help is greatly appreciated, thanks!