Last active
June 17, 2019 18:15
-
-
Save DanishAmjad12/3d4fcbf0162e6e1f05f88502e8ed1f11 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//Insert Case | |
val thread = Thread { | |
var bookEntity = BookEntity() | |
bookEntity.bookId = 1 | |
bookEntity.bookName = "Kotlin for Android Developer" | |
db.bookDao().saveBooks(bookEntity) | |
//fetch Records | |
db.bookDao().getAllBooks().forEach() | |
{ | |
Log.i("Fetch Records", "Id: : ${it.bookId}") | |
Log.i("Fetch Records", "Name: : ${it.bookName}") | |
} | |
} | |
thread.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment