Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. //run this on default background thread
  2. runOnDefaultThread({
  3. firstNote = NoteRepository.getOrCreateFirstNote(applicationContext)
  4. firstNoteLive = NoteRepository.getLiveDataNoteById(applicationContext, firstNote.id)
  5.  
  6. //run on main thread
  7. runOnUiThread {
  8. firstNoteLive.observe(this, Observer<Note> {
  9. Log.v(TAG, "First note is changed, value: ${it.content}")
  10. })
  11. }
  12. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement