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 Adapting Data for Display in a List Filling Our String Array and Creating the Adapter

JSONException: Unterminated string

When I try to run the app with the NUMBER_OF_POSTS set to 20, I get the following exception:

org.json.JSONException: Unterminated string at character 5822 ... (Shortened) ... "title":"New Courses: Node JS Basics & Re

It appears to me that perhaps the String type isn't long enough to hold that much data since it doesn't break when the NUMBER_OF_POSTS is a lesser value, but why is it that Ben can run this program just fine?

1 Answer

Harry James
Harry James
14,780 Points

Hey David!

Take a look at Hubert Maraszek's fix for this over here!

A lot of users have had this issue but, his fix seems to have worked for everyone so far :)

If it helps you, be sure to give him a Vote up on the page!

Hope it helps :)