I Did It to Myself, 78 of 100 Days…
I tripped myself up. I am the architect of my own bugs.
You can find a video of this at the bottom of the page and a link to the source code here.
I reviewed my code for the new bug and followed the tutorial a second time. The first thing I did was update my layout for the MainActivity to a RelativeLayout (click below).
I tried rebuilding the app, but no luck. It looked like I forget to add the ArrayList object to the ArrayAdapter constructor. But after adding it in, I rebuilt the app, and it STILL appeared blank. I followed through the tutorial again, and everything appeared to match in my code. Everything, except the DatabaseReference object.
Apparently, I had code leftover from the previous tutorial. My code still invoked the .child() method on the reference assignment for the DatabaseReference object. After removing the .child() method invocation, the list appeared as expected! (click below).
Moving forward, when I change to a new tutorial, I’ll start my project over. Keeping that leftover code ended up costing me more time in the long run. Looks like I learned two things today.
Next time I’ll work on the Realtime Database for a different project…the Salesman’s Travel app.
Join the mailing list to see updates like this every week!
Coding Fanatic
Image by PublicDomainPictures from Pixabay