Intent gives error


I’m trying to make a simple app, in this app there is only one button and when its clicked it will switch to another new activity

first activity code:

button.setOnClickListener { var intent = intent(this, startActivity(intent) }
intent becomes red with this error showing: “expression intent of type intent cannot be invoked as a function. the function invoke is not found”

what is the problem?


solved this error, all i had to do is add this line: import android.content.Intent