Bug Fixing: BookLog Application

#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

--

--

--

Technical Speaker and an aspiring writer with avid addiction to gadgets, meet-up groups, Kotlin and paper crafts.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Android Phone hacking Remotely by using Metasploit:

Use Bottom Navigation in kotlin with Android Studio.

Data Flow From Backend To Frontend/ [Software Developer in Test Article Series Part 5]

Fix “Login Error: There is an error in logging you into this application”: Facebook Login w/…

Best android custom ROM’s worth a try.!

Improving testability in Android MVVM with Dagger 2

Performance comparison: building Android Layout with XML vs By Code vs Jetpack Compose

Integration of Huawei Ads Kit, Account Kit and Scan Kit in Scanner Application

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Henna Singh

Henna Singh

Technical Speaker and an aspiring writer with avid addiction to gadgets, meet-up groups, Kotlin and paper crafts.

More from Medium

Integration of Huawei Account Kit in Book Reading Android app (Kotlin)

Awesome Kotlin scope functions

Asynchronous Android : Kotlin Coroutines

Room DB relations in android made simple with Kotlin