Created
January 25, 2018 23:22
-
-
Save umarov/31b29bd3e239906ec6849c1541822312 to your computer and use it in GitHub Desktop.
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
inline fun createTodoList(name: String, crossinline afterCreate: (todoList: TodoList) -> Unit) { | |
Thread(Runnable { | |
val todoList = TodoList(name) | |
db.todoListDao().insertTodoList(todoList) | |
Handler(Looper.getMainLooper()).post { afterCreate(todoList) } | |
}).start() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment