voben
12/30/2019, 9:23 PMCannot find Identifier Person
. How do I resolve this?
android:onClick="@{() -> viewModel.doSomething(Person())}"
Mark Murphy
12/30/2019, 11:46 PMdoSomething()
create the Person
object. Or, create doSomethingWithANewPerson()
that you call from the data binding expression, where it creates the Person
object and calls doSomething()
.rattleshirt
01/06/2020, 8:26 PMandroid:onClick="@{() -> viewModel.doSomething(person)}"
Roman Donchenko
01/30/2020, 9:43 AMPerson()
You defenetly can’t construct new objects using new
operator. Use @Mark Murphy suggestion. Or if you really need to create a new object instance using databinding - use static methods like Person.newInstance
kagomez
02/06/2020, 4:35 PM