Getting crash of realm again n again


#1

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

I am getting above issue again n again and not able to solve due to lack of information.

Kindly help me out for this.


#2

You don’t need more info, the problem is in the error message. Check those things, and you will find your issue.


#3

Thanks for your reply !!!
I used “*realm = Realm.getDefaultInstance();” this every time whenever I fetched realm model classes still this is giving problem.


#4

Do you also have “Realm.init(context);” ?

Also, thats only the first part of the error message.


#5

I advise reading the documentation in this regard: https://realm.io/docs/java/latest/#realm-instance-lifecycle