Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Blog Reader Android App Getting Data from the Web Getting JSON Data from an HTTP Request

Greg Hesp
Greg Hesp
1,808 Points

Is there an issue with the challenge?

I have this running on my device successfully and working, however using the same code with adjusted variables for the challenge does not seem to work. The error given is:

JavaTester.java:74: responseData is already defined in run() String responseData = new String(charArray); ^ 1 error

Unfortunately, I do not have a line 74 and run isn't defined in my code, so I can only assume this is something in the background?

1 Answer

Mark Josephsen
Mark Josephsen
8,803 Points

If responseData is already defined, it means you have already created a String object with that name. Strings are immutable, meaning you can't change them once you've defined them. So, instead of changing the existing String object, you'll need to create a new String object with the same name:

responseData = new String(charArray);