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

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