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

Getting JSON Data from an HTTP request Code challenge

On the final task of the challenge 5 of 5 I set the String variable responseData = new String(charArray); as it is in the video shown , also in the same way it is in the project files source code of the app. I've double and triple check the syntax and it looks fine. But the compiler error still throwin a message "JavaTester.java:74: responseData is already defined in run() String responseData = new String(charArray); ^ 1 error"

I am not able to complete the code challange.

Thanks in advance.

2 Answers

Thank you very much Andrew , responseData variable was set above the try block by default in the Code Challenge. Your adivse give me a comlpeted challenge.

Thanks , cheers :)

Without seeing your code, I couldn't say for certain but it sounds like you've already declared responseData as a variable in that function.

Try this

responseData = new String(charArray);

instead of this

String responseData = new String(charArray);