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!
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
I get a java.lang.NullPointerException on mChoice2.setText(page.getChoice2().getText()); removing it makes it work
I get this error Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.example.android.interactivestory.model.Choice.getText()' on a null object reference at com.example.android.interactivestory.ui.StoryActivity.loadPage(StoryActivity.java:61) at com.example.android.interactivestory.ui.StoryActivity.onCreate(StoryActivity.java:49)
My GIT Repo is https://github.com/iandjx/InteractiveStory.
Ok I made a stupid mistake. Apparently line 14 in Page.java. I duplicated mChoice1 instead of mChoice 2. See diff in my commits :) Everything is now working.
I love the debugger!