Bug Fixing: BookLog Application

Henna Singh
2 min readMar 4, 2022

--

#BuildTogether Day 26/100

Today was a tiring day, we went for house viewing almost 90 minutes train ride from our current place to find out the views we liked were already sold out :(

I have great news too…. I unlocked a new badge on finishing my 25th day :P I am absolutely in love with these badges ❤ But more than that, I am in love with #100DaysOfCode… I know it is hard to keep the discipline but somehow, something is moving me on and I am happy about it 😍

So, today I decided not to procrastinate more on my BookLog Application and finish the missing pieces to complete the app.

I am coming back to full-fledged App development after almost 2 years, and I am frequently getting stuck on several things but I am absolutely bashing concepts and I will be a better developer in no time ;)

So I joined forces with an Android GDE Himanshu Singh for some guidance and I found out I had made such grave errors in my application :-/

Fix 01:

Adding UI interaction code in theonStart() method of the Activity. This is a complete No as he suggested, we should add interactable code in the onCreate() method of Activity.

Library Activity Fixing

I made similar fixes in BookListFragment as well; moved all UI interaction code from onStart() to onAttach() and/or custom method call.

Fix 02

I also got advised that using View Binding is a better idea than using Kotlin extensions as that is long gone and no developer would like that in an Open Source project.. :-/

BookListFragment Fixing

Adding View Binding to the code, let to another error which I am stuck at and not able to fix :-/

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.geek.booklog/com.geek.booklog.LibraryActivity}: android.view.InflateException: Binary XML file line #22 in com.geek.booklog:layout/activity_library: Binary XML file line #22 in com.geek.booklog:layout/activity_library: Error inflating class fragmentCaused by: android.view.InflateException: Binary XML file line #22 in com.geek.booklog:layout/activity_library: Binary XML file line #22 in com.geek.booklog:layout/activity_library: Error inflating class fragment
Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.geek.booklog.ui.BookListFragment: calling Fragment constructor caused an exception

I am going to look at this error tomorrow and I am absolutely going to have this app running…

“I solemnly swear, I will have this application running tomorrow” :P

--

--

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