Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Jeremy Broutin1,951 Points
NullPointerException on navigation back button
When testing the app at this stage of the learning path, it works fine (aka I got the list of messages in my inbox) apart from the use of the navigation back button which causes the app to crash. Looking at the logcat, I can see that I get a NullPointerException. Reading stackoverflow, a member mentions that it's probably due to the setListAdapter: "You should look at where you're calling setListAdapter and where you're initializing the List that you pass into it. You need to ensure that your List has been initialized first."
Could you please help to correct this bug?
Thanks a lot :)
Where are you getting the NullPointerException - Logcat should tell you what line that's happening at and you can see what line that is.
It might be wise running the code in the debugger and putting some breakpoints around to track down where this is happening but let's start with Logcat.