Why LiveData observer is being triggered twice for a newly attached observer

后端 未结 12 2079
北荒
北荒 2020-12-12 18:03

My understanding on LiveData is that, it will trigger observer on the current state change of data, and not a series of history state change of data.

12条回答
  •  青春惊慌失措
    2020-12-12 18:22

    I used SingleLiveEvent and works. When fragment/activity is resumed or recreated SingleLiveEvent not throw the event, only when explicitly changes

提交回复
热议问题