How to stop LiveData event being triggered more than Once
问题 I am using MutableLiveData within my application for event based communication. I have single activity two fragments architecture. With the help of ViewModel, I'm consuming the LiveData events in Fragment-1. But, when I replace this Fragment-1 with Fragment-2 using Menu bar and finally come back to Fragment-1, old values of LiveData are captured again. How to avoid this problem? Any help/suggestions are highly appreciated! Thank you. 回答1: You can use Event to wrap LiveData values to handle