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 Android Lists and Adapters (2015) Lists with RecyclerViews Creating a RecyclerView ViewHolder

Qiyuan Zhang
Qiyuan Zhang
10,581 Points

Why does java.lang.NullPointerException (Look around JavaTester.java line 129) pop up for task 3?

The error message is not providing useful information anyway...

could you post the code of that line?

I think in general a NulPointerException means that there is a reference variable that points to something that is not there(anymore?)

2 Answers

Qiyuan Zhang
Qiyuan Zhang
10,581 Points

Thanks Chris and Michael. I got the problem solved. It's due to one unnecessary keyword "static" when defining class.

Michael Farber
Michael Farber
1,103 Points

Hi Qiyuan, I agree with Chris. This happened to me once when I tried to call the findViewById method before setting the content layout in java. Maybe this is what's wrong with your code. If it's not, post it and we'll be able to help you more specifically:)