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 Using Intents to Display and Share Posts Opening a Webpage in the Browser

Edward Poon
Edward Poon
9,313 Points

JSON works and then doesn't work.

I don't understand why I get errors randomly after I get the whole JSONArray from posts. It'll work for posts of 20 and then it wont work and then it'll work.

1 Answer

Calvin Nix
Calvin Nix
43,828 Points

Hey Edward,

You mentioned that you are getting random errors. Please provide the error messages.

Thanks, Calvin

Edward Poon
Edward Poon
9,313 Points

I ran the code that was provided in the project files and this is the error I get occasionally.

07-29 17:42:17.371: E/MainListActivity(2246): org.json.JSONException: Unterminated string at character 5731 of {"status":"ok","count":20,"count_total":1800,"pages":90,"posts":[{"id":23911,"url":"http:\/\/blog.teamtreehouse.com\/jquery-plugins-html-tables","title":"jQuery Plugins for HTML Tables","date":"2014-07-29 12:24:28","author":"Nick Pettit","thumbnail":"http:\/\/blog.teamtreehouse.com\/wp-content\/uploads\/2014\/07\/stackable-150x150.png"},{"id":23906,"url":"http:\/\/blog.teamtreehouse.com\/developer-interview-paul-irish","title":"Developer Interview: Paul Irish","date":"2014-07-28 09:41:52","author":"Gill Carson","thumbnail":"http:\/\/blog.teamtreehouse.com\/wp-content\/uploads\/2014\/07\/paul_irish-150x150.jpg"},{"id":23930,"url":"http:\/\/blog.teamtreehouse.com\/treehouse-show-bloopers","title":"Sneak Peek: Behind the Scenes of the Treehouse Show","date":"2014-07-25 09:39:55","author":"Gill Carson","thumbnail":"http:\/\/blog.teamtreehouse.com\/wp-content\/uploads\/2014\/07\/bloopers-150x150.jpg"},{"id":23460,"url":"http:\/\/blog.teamtreehouse.com\/handle-revision-requests-web-design-projects","title":"How to Handle Re�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������