Hi, I have a method with the signature below: `fun...
# android-databinding
s
Hi, I have a method with the signature below:
fun function(paramFunction: (() -> Entity)?)
I am trying to pass the specified
paramFunction
as null through databinding:
android:onClick="@{() -> viewModel.function(null)}"
But I got an exception during compilation:
Copy code
[kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors.
****/ data binding error ****msg:cannot find method function(java.lang.Object) in class…
Does anyone have an idea how I can resolve this please?
g
I always had trouble with kotlin lambdas & databinding. I use regular interfaces instead.
👍 1
d
Maybe with the
paramFunction
as optional parameter and @JvmOverload annotation