// инициализировали обьект кнопки
// указали обьект кнопки на элемент внутри XML
val registerButton = findViewById<Button>(R.id.main_activity_register_button)
// прикрепили обработчик нажатия к нашей кнопки
registerButton.setOnClickListener {
val intentToAnotherScreen = Intent(this, RegistrationActivity::class.java)
startActivity(intentToAnotherScreen)
makeText(this@MainActivity, "You clicked me.", LENGTH_SHORT).show()
val loginButton = findViewById<Button>(R.id.main_activity_login_text)
loginButton.setOnClickListener {
val intentToScreen = Intent(this, LoginActivity::class.java)
startActivity(intentToScreen)
}
}
}
}