https://kotlinlang.org logo
#android
Title
# android
j

Joshua

03/22/2020, 3:56 PM
I'm trying to do the following:
Copy code
app:logo="@{viewModel.toolbarViewConfig.isMenuVisible}"
but I get the error
Copy code
Cannot find a setter for <androidx.appcompat.widget.Toolbar app:logo> that accepts parameter type androidx.lifecycle.MutableLiveData<java.lang.String>

If a binding adapter provides the setter, check that the adapter is annotated correctly and that the parameter type matches.
I somehow want to set the app:logo to empty. I tried it here:
Copy code
viewModel.toolbarViewConfig.isMenuVisible.value = ""
v

Victor

03/22/2020, 4:43 PM
There isn’t method Toolbar.setLogo with String parameter. take a look here: https://developer.android.com/reference/androidx/appcompat/widget/Toolbar#setLogo(int) Create your own Binding adapter: https://developer.android.com/topic/libraries/data-binding/binding-adapters
1