I’m trying to use reflection to get the name of cl...
# getting-started
e
I’m trying to use reflection to get the name of classes extending a sealed class, but I always get the name of the sealed class (
ConnectionState
). Here’s my code:
Copy code
public sealed class ConnectionState() {
        var name = ConnectionState::class.simpleName ?: "null"

        object Isolated : ConnectionState()
        object Advertising : ConnectionState()  
        object Discovering : ConnectionState()
   }
Any advice?
The symbol
javaclass
isn’t recognized.
I’m running on Android.
It worked perfectly. Thank you!