diff --git a/app/src/main/java/jackall/devrealm/viewmodel/MainViewModel.kt b/app/src/main/java/jackall/devrealm/viewmodel/MainViewModel.kt index 3f19c58..8ba2906 100644 --- a/app/src/main/java/jackall/devrealm/viewmodel/MainViewModel.kt +++ b/app/src/main/java/jackall/devrealm/viewmodel/MainViewModel.kt @@ -20,11 +20,12 @@ class MainViewModel : LifecycleViewModel() { var adapter: MainAdapter? = null - val personRealmHelper = PersonRealmHelper() + lateinit var personRealmHelper: PersonRealmHelper lateinit var realmChangeListener: OrderedRealmCollectionChangeListener> override fun onCreate() { super.onCreate() + personRealmHelper = PersonRealmHelper() val items = ArrayList() realmChangeListener = OrderedRealmCollectionChangeListener { results, changeSet -> changeSet.insertions.forEach {