We need to write this line with the extension .java, although its extension is .kt I think the Kotlin file is converted to a java file, but java is also converted to byte code, so we can also use a .class file. If the Kotlin code is converted to Java code.
NextActivity::class.java before NextActivity::class.kt //not worked
btn?.setOnClickListener {
startActivity(Intent(this, NextActivity::class.java))
}
So the question is why we are writing .java in NextActivity::class.java
The question arises from here .
source
share