Fix the events order

This commit is contained in:
Tommaso Berlose
2020-10-16 11:58:02 +02:00
parent 6150dd7e22
commit 6ea97e7724
7 changed files with 60 additions and 37 deletions

View File

@ -18,7 +18,7 @@ import kotlin.collections.ArrayList
class EventRepository(val context: Context) {
private val realm by lazy { Realm.getDefaultInstance() }
fun saveEvents(eventList: ArrayList<Event>) {
fun saveEvents(eventList: List<Event>) {
realm.executeTransaction { realm ->
realm.where(Event::class.java).findAll().deleteAllFromRealm()
realm.copyToRealm(eventList)