Created
November 27, 2017 01:42
-
-
Save larkintuckerllc/3453543106fd0a4d4c867a5270d2af9c to your computer and use it in GitHub Desktop.
Android Room: Beyond the Codelab - 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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