java.lang.IllegalStateException

Realm instance has been closed or this object or its parent has been deleted.

Solutions on the web12378

  • via Stack Overflow by Michael
    , 2 months ago
    Realm instance has been closed or this object or its parent has been deleted.
  • This Realm instance has already been closed, making it unusable.
  • via GitHub by zaki50
    , 1 month ago
    This Realm instance has already been closed, making it unusable.
  • Stack trace

    • java.lang.IllegalStateException: Realm instance has been closed or this object or its parent has been deleted. at io.realm.RealmList.checkValidView(Unknown Source) at io.realm.RealmList.size(Unknown Source) at io.realm.RealmBaseAdapter.getCount(Unknown Source) at android.widget.AdapterView$AdapterDataSetObserver.onChanged(AdapterView.java:826) at android.widget.AbsListView$AdapterDataSetObserver.onChanged(AbsListView.java:6728) at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37) at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50) at io.realm.RealmBaseAdapter$1.onChange(Unknown Source) at io.realm.RealmBaseAdapter$1.onChange(Unknown Source) at io.realm.internal.Collection$RealmChangeListenerWrapper.onChange(Unknown Source) at io.realm.internal.Collection$CollectionObserverPair.onChange(Unknown Source) at io.realm.internal.Collection$Callback.onCalled(Unknown Source) at io.realm.internal.Collection$Callback.onCalled(Unknown Source) at io.realm.internal.ObserverPairList.foreach(Unknown Source) at io.realm.internal.Collection.notifyChangeListeners(Unknown Source) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:328) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:5728) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.