Ambran
Ambran

Reputation: 2627

Access Kotlin enum from Java

I have an enum defined in a Fragment companion object:

enum class Channel {
    TAG_FRIENDS, CHALLENGE_INVITE, COMMITMENT_INVITE
}

Normaly I'll access it from another Kotlin class like that:

MyFragment.Companion.Channel.TAG_FRIENDS

How would I access it from a Java class? The Channel enum doesn't seem to be accessable...

Upvotes: 3

Views: 4341

Answers (1)

Wale
Wale

Reputation: 1806

Just in case anyone still need this:

 Channel.TAG_FRIENDS.getValue()

Upvotes: 7

Related Questions