Skip to content

Instantly share code, notes, and snippets.

@Zhuinden
Last active December 22, 2017 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zhuinden/8a8ec61bb13f97ff556b50c782311aaf to your computer and use it in GitHub Desktop.
Save Zhuinden/8a8ec61bb13f97ff556b50c782311aaf to your computer and use it in GitHub Desktop.
Monarchy article: Room
@Query("SELECT * FROM " + Task.TABLE_NAME +
" ORDER BY " + Task.COLUMN_DATE + " ASC ")
LiveData<List<Task>> tasksSortedByDate();
tasksSortedByDate().observe(this, (newTasks) -> {
adapter.updateData(newTasks);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment