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 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);