BookLog Application: Resolving Errors

Henna Singh
2 min readFeb 23, 2022

--

#buildtogether Day 17/100

Today has been a looooooonnnnggggg day. I could not make a lot of progress on the BookLog App as much as I wanted to but I worked on a separate topic as well which I will be able to share tomorrowv=)

So, for the BookLog app, I worked some more on the Booklist Fragment, to get information on the list of Books from the Realm Database and display it via Recycler View.

The code for BookList Fragment looks like below:

I accidentally added the getInstanceAsync code for Realm in the onStart method of the fragment when the Realm Kotlin team-mate pointed out that onCreateView is called before onStart and my logic for setting up Recycler View will fail… got saved from a fatal error…. See Collaboration works wonders ❤

So here is the lifecycle chart which I should print in my head ;) With Realm, needs to be extra careful when you are opening and/or closing it. And you should always close your Realm instances, or otherwise, it leads to memory leaking.

In the Book Fragment, I am still stuck on creating a multi-selector drop-down. I absolutely have no idea why the code is throwing off…. 🙄

This is the snapshot of the error:

If anyone out here, reading my journal feels pity for me… I will be grateful and I will send you coffee… ☕️ :D

On a different note, I worked on documenting Sync Types and explained more on Partition Based and Flexible Sync as my Weekly Realm Bytes, but I will be able to share more on that tomorrow 👋

--

--

Henna Singh
Henna Singh

Written by Henna Singh

Technical Speaker and an aspiring writer with avid addiction to gadgets, meet-up groups, and paper crafts. Currently doing Full Stack Diploma at Code Institute

No responses yet