I have a domain object, let's say User
:
class User(var id: String, var name: String) {
init {
EventBus.getDefault().register(this)
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onNewName(event: NewNameEvent) {
this.name = event.newName
}
}
This class is notified by global EventBus. From the other side, there is a ViewModel (of activity) which has:
val user = MutableLiveData<User>(Application.my.user)
Issue is that viewModel's user
doesn't react on any changed made by event bus in Application.my.user
. What do I miss?