Issue
In Kotlin checkbox from XML databinding I want to pass 3 arguments checked or not (Boolean) and Two Strings.
Currently I am passing as below
android:onCheckedChanged="@{(switch, checked) -> availMasterVm.onCheckedChangedMondayMrng(checked)}"
when I add String I am getting error how to pass strings to the viewmodel method
Solution
You can pass the extra parameters in just the usual way. Just remember that for strings you need to use back-ticks(``) instead of double quotes("").
android:onCheckedChanged="@{(switch, checked) -> availMasterVm.onCheckedChangedMondayMrng(checked, `Monday`, `Morning`)}"
Answered By - Arpit Shukla
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.