startActivity(Intent(this @ MainActivity,NextActivity :: class.java)) p>
It’s kotlin, why do we add .java after class? Why not kt?
java
methods/extended attributes, it provides you java.lang.ClassYou can even check out the source -code for that java
property.
According to the kotlin doc, we use the following syntax to start a new activity
startActivity(Intent(this @ MainActivity,NextActivity :: class.java))
It’s kotlin, why do we add .java after class? Why not kt?
Because NextActivity::class provides you with KClassjava
Attribute, it provides you java.lang.Class
You can even check out the source-code for that java
property.