Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //run this on default background thread
- runOnDefaultThread({
- firstNote = NoteRepository.getOrCreateFirstNote(applicationContext)
- firstNoteLive = NoteRepository.getLiveDataNoteById(applicationContext, firstNote.id)
- //run on main thread
- runOnUiThread {
- firstNoteLive.observe(this, Observer<Note> {
- Log.v(TAG, "First note is changed, value: ${it.content}")
- })
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement