Skip to content
Coding Fanatic
  • Android Development
  • News and Reviews
  • Road2Pro
  • Tutorials
  • Services
  • About

Stuck Yet Again! 77 of 100 Days of Code

  • September 3, 2020September 4, 2020
  • by Richard Clarke

I finished the new tutorial, but my screen is blank!

You can find a video of this at the bottom of the page and a link to the source code here.

I finished the newest tutorial I found for populating a ListView using Firebase. But now my app screen is blank.

I went back and added comments to the MainActivity for the steps I followed thus far. I confirmed the DatabaseReference object was properly instantiated so the app could pull data from the database (click below).

I included the comments in order to document the process I’ve followed thus far. Often times code can be tricky to remember. By including the steps, I can quickly remember how to perform these tasks.

After this, I added a ChildEventListener to the DatabaseReference object. I overrode the onChildAdded and onChildChanged methods to add entries from the database to the ArrayAdapter, and update with dataset changes respectively (click below).

The ChildEventListener would allow the app to update the displayed information whenever a change is made to the Realtime Database. This way I don’t have to keep changing the app whenever I update the database on the back end.

Once this was complete, I set the adapter for the ListView and rebuilt my app. Setting the adapter was necessary in order to display the ListView. But for some reason, after I finished, the app’s screen was entirely blank (click below).

I can’t seem to catch a break with these tutorials. At least this time I didn’t have any compiler errors at the end.

Next time I’ll review the code thoroughly and compare to the tutorial to ensure everything is as it should be. If this doesn’t work, I’ll just have to find another tutorial, again.

Join the mailing list to see updates like this every week!
Coding Fanatic

Related

Back on the Wagon! 76 of 100 Days of Code
I Did It to Myself, 78 of 100 Days of Code
Richard Clarke
Richard is currently a developer using Java and Android Studio to build custom applications for Android. Richard tutored in mathematics at Montgomery College, and worked in Information Technology before entering the Software Development industry as a Quality Engineer.
100daysofcode Android AndroidDev Firebase Java software software develo

Related articles

Your New Favorite Stopwatch App!…
Two for Two BABY! 7…
…But the App is for…
Play Store Blues – 5…
Top 4 Tips for Android…
No Dice – 3 of…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Join the mailing list!

This field is required.

Check your inbox or spam folder to confirm your subscription.

Follow me on social media!

  • GitHub
  • YouTube
  • X
  • Instagram
  • LinkedIn
My Tweets

Join the mailing list!

This field is required.

Check your inbox or spam folder to confirm your subscription.

Follow me on social media!

  • X
  • GitHub
  • LinkedIn
  • YouTube

Archives

Theme by Colorlib Powered by WordPress