Skip to content

Instantly share code, notes, and snippets.

@larkintuckerllc
Created November 27, 2017 01:42
Show Gist options
  • Save larkintuckerllc/3453543106fd0a4d4c867a5270d2af9c to your computer and use it in GitHub Desktop.
Save larkintuckerllc/3453543106fd0a4d4c867a5270d2af9c to your computer and use it in GitHub Desktop.
Android Room: Beyond the Codelab - 7
...
public void addTodo(String name, long date) {
Todo todo = new Todo();
todo.name = name;
todo.date = date;
new Thread(() -> {
mDb.todoModel().insertTodo(todo);
}).start();
}
public void removeTodo(int id) {
Todo todo = new Todo();
todo.id = id;
new Thread(() -> {
mDb.todoModel().deleteTodo(todo);
}).start();
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment