I want to start another activity on Android but I get this error:
Please specify constructor invocation; classifier \'Page2\' does not have a companio
You can use both Kotlin and Java files in your application.
To switch between the two files, make sure you give them unique < action android:name="" in AndroidManifest.xml, like so:
Then in your MainActivity.kt (Kotlin file), to start an Activity written in Java, do this:
val intent = Intent("com.genechuang.basicfirebaseproject.JavaActivity")
startActivity(intent)
In your MainActivityJava.java (Java file), to start an Activity written in Kotlin, do this:
Intent mIntent = new Intent("com.genechuang.basicfirebaseproject.KotlinActivity");
startActivity(mIntent);