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 trialMasum Bergmann
Courses Plus Student 4,129 PointsJSON Data missing (when passed to member variable in onPostExecute() method)
Hi all,
After having passed the JSON object from doInBackground() to onPostExecute() and then set a member variable equal to the JSON object, when I then "read" the member variable by way of Log.d, only the array part of the object shows up in the log and the preceding "properties" (such as: "status": "ok", "count": 20, "count_total": 1724, "pages": 87,) are no where to be found.
I get the feeling that I'm missing something really obvious... can anyone help me out?
Cheers,
Masum
Edit: However, if specifically requesting the data that I can't see by way of .getString("status") it appears, so it's there but just won't be printed to the log when doing the above... hmmm...
1 Answer
Ben Jakuben
Treehouse TeacherCan you paste in all the code from your Activity class to help troubleshoot?
Masum Bergmann
Courses Plus Student 4,129 PointsMasum Bergmann
Courses Plus Student 4,129 PointsThank you for replying to this post... this issue was actually caused by the
getContentLength()
method, couple of your posts here in the forum and the info in the Teacher's Notes helped me solve this issue already! But thanks for following up!Ben Jakuben
Treehouse TeacherBen Jakuben
Treehouse TeacherExcellent, glad you got it! And sorry about the bug. :-/