我试图在Android Studio中使用Kotlin设置Intent
,以启动另一个Activity.kt
:
val i : Intent = Intent(this, MainActivity::class.java)
Android Studio显示错误,无法编译:
Error:(23, 26) None of the following functions can be called with the arguments supplied:
public constructor Intent(p0: Context!, p1: Class<*>!) defined in android.content.Intent
public constructor Intent(p0: String!, p1: Uri!) defined in android.content.Intent
我认为语法是正确的,那么问题在哪里呢?