我试图Intent在Android Studio的Kotlin中设置以启动另一个Activity.kt:
val i : Intent = Intent(this, MainActivity::class.java)
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
我认为语法是正确的,那怎么了?