Closed levibostian closed 7 years ago
Realm docs have ideas for how to close realm instances correctly. It is the responsibility of the Activity/Fragment/AsyncTask/Thread to close them.
Have SampleDao (BaseDao) take in an instance of Realm provided by Dagger. Then have BaseDao implement a close() function that closes Realm. Therefore, you will actually call close() on the Dao class when you need it in the app.
close()
This is done in another lib, not AndroidBlanky. AndroidRealm or Wendy?
Done. This is done via the new Android Lifecycle stuff.
Realm docs have ideas for how to close realm instances correctly. It is the responsibility of the Activity/Fragment/AsyncTask/Thread to close them.
Have SampleDao (BaseDao) take in an instance of Realm provided by Dagger. Then have BaseDao implement a
close()
function that closes Realm. Therefore, you will actually callclose()
on the Dao class when you need it in the app.