Skip to content

Instantly share code, notes, and snippets.

@DanishAmjad12
Last active June 17, 2019 18:15
Show Gist options
  • Save DanishAmjad12/3d4fcbf0162e6e1f05f88502e8ed1f11 to your computer and use it in GitHub Desktop.
Save DanishAmjad12/3d4fcbf0162e6e1f05f88502e8ed1f11 to your computer and use it in GitHub Desktop.
//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