Skip to content

Instantly share code, notes, and snippets.

@larkintuckerllc
Created November 27, 2017 01:44
Show Gist options
  • Save larkintuckerllc/889827b7541812aeea526e716ec54547 to your computer and use it in GitHub Desktop.
Save larkintuckerllc/889827b7541812aeea526e716ec54547 to your computer and use it in GitHub Desktop.
Android Room: Beyond the Codelab - 9
...
mTodosViewModel.todos.observe(this, (todos -> {
new Thread(() -> {
DiffUtil.DiffResult result = DiffUtil.calculateDiff(new DiffUtil.Callback() {
...
});
self.runOnUiThread(() -> {
result.dispatchUpdatesTo(todosAdapter);
mTodos = todos;
mProgressDialog.hide();
});
}).start();
}));
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment