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 generally simplify the specification of the parameter BlahActivity::class.java by defining an inline reified generic function.
inline fun Context.createIntent() =
Intent(this, T::class.java)
Because that lets you do
startActivity(createIntent())
Or even simpler
inline fun Activity.startActivity() {
startActivity(createIntent())
}
So it's now
startActivity()