Skip to content

Instantly share code, notes, and snippets.

@jutikorn
Created December 7, 2018 12:35
Show Gist options
  • Save jutikorn/33d47c398a9ab2d38ffffa14bc497e4b to your computer and use it in GitHub Desktop.
Save jutikorn/33d47c398a9ab2d38ffffa14bc497e4b to your computer and use it in GitHub Desktop.
LiveData<String> source = ....; //
final MediatorLiveData<String> result = new MediatorLiveData<>();
result.addSource(source, new Observer<String>() {
@Override
public void onChanged(@Nullable String x) {
// do something here
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment