As bashor
suggested, use MyEnum.valueOf()
but please have in mind that it throws an exception if value can't be found. I recommend using:
enum class MyEnum {
Foo Bar Baz
}
try {
myVar = MyEnum.valueOf("Qux")
} catch(e: IllegalArgumentException) {
Log.d(TAG, "INVALID MyEnum value: 'Qux' | $e")
}