There is simple solution in Transformations method distinctUntilChanged
.expose new data only if data was changed.
In this case we get data only when it changes in source:
LiveData<YourType> getData(){
return Transformations.distinctUntilChanged(LiveData<YourType> source));
}
But for Event cases is better to use this:
https://stackoverflow.com/a/55212795/9381524