kotlin binding example
//In build.gradle(Module) add this
buildFeatures {
viewBinding true
}
//In HomePage.kt
class HomePage : AppCompatActivity()
{
//This line changes depending on the class name. Also there's an import
private lateinit var binding: ActivityHomePageBinding
override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState)
binding = ActivityHomePageBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.BTNLoginToAccount.setOnClickListener {
val nextPage = Intent(this, Login::class.java)
startActivity(nextPage)
}
}
}