Kotlin enum class in Android performance

Viewed 7390

In Java we are told to strictly avoid using enums on Android because they take up twice the memory.

Does this apply to enum class in Kotlin aswell? Will a Kotlin enum be compiled into a Java enum?

3 Answers

You can most definitely use enums in Android now, they specifically discussed this topic in this Google I/O video: https://www.youtube.com/watch?v=IrMw7MEgADk (if you don't want to watch the whole video, then start from 11:30 ish to 14:40).

Related