Android data binding : view does not update when property is changed
Solution 1:
In case you might be experiencing this issue with LiveData
, you might've forgotten to set lifecycle owner of your binding;
binding.setLifecycleOwner(lifecycleOwner)
Solution 2:
I had a similar issue when I needed to refresh the views after an event, with my variable objects not observable, so I added this:
binding?.invalidateAll()
I hope it helps.