Answer the question
In order to leave comments, you need to log in
Without using dataBinding, what would be a similar entry?
There is such an entry using dataBinding.
In this case, it is enough to write like this, and all variables from the ViewModel class will be associated with the layout id.
And if you do not use dataBinding, then I have to assign all the variables, but this approach seems bad to me:
fun onLoginButtonClick(view: View) {
viewModel.email = binding.edtEmail.toString()
viewModel.password = binding.edtPassword.toString()
viewModel.onLoginButtonClick(view)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question