Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. val instance = Realm.getDefaultInstance()
  2.  
  3.  
  4. boats.forEach {
  5. instance.beginTransaction()
  6. val newBoat = instance.createObject(Boat::class.java)
  7. newBoat.id = it.id
  8. instance.insertOrUpdate(newBoat)
  9. instance.commitTransaction()
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement