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

Android Build a Self-Destructing Message Android App Starting the App Adding the Sign Up Screen

TZECHUNG KAO
TZECHUNG KAO
11,238 Points

NullPoniterException using fragment_sign_up.xml

I have to use fragment to create new signup activity with the latest Eclipse IDE. I was using fragment_sign_up.xml instead of activity_sign_up.xml. I tried to add codes for mSignUpTextView.setOnClickListener in On_Create method, I got NullPointerException error on running.

3 Answers

Eric De Wildt
PLUS
Eric De Wildt
Courses Plus Student 13,077 Points

The null pointer error report should tell you what line the problem code is on. This is a fine place to start looking for the problem.

TZECHUNG KAO
TZECHUNG KAO
11,238 Points

Thanks. I found the line within LoginActivity.java. The object mSignUpTextView was not created on the fragment_sign_up.xml layout when it is called within LoginActivity .java. The lesson did not tell us how to go around this problem using fragment layout instead not using fragment layout in building a SelDestructing Meesage Android App. I was forced to use fragment layout for the latest Android plug in for Eclipse.

TZECHUNG KAO: Can you tell me how you resolved the error? The entire code