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 trialSexual Potatoes
12,051 Points"JSONException: No value for current" - response is successful but code doesn't run due to an exception
I've been using the debugger, and the following try { } catch block never runs successfully, and always goes straight for the exception (never filling mCurrentWeather or running updateDisplay();
try { mCurrentWeather = getCurrentDetails(jsonData); runOnUiThread(new Runnable() { @Override public void run() { updateDisplay(); } }); } catch (JSONException e) { e.printStackTrace(); }
What am I doing wrong?
I've done a few Treehouse courses, and this is the first that I've been disappointed with so far. TreeHouse seems to be jumping into a lot of heavy concepts without explaining things thoroughly, so now that I've bumped into what's probably an easy error to fix I find myself unable to for lack of what's supposed to be basic understanding. A lot of the code in the videos and exercises is also out of date.
Niyamat Almass
8,176 PointsNiyamat Almass
8,176 PointsPlease show your MainActivity.java with correct format using markdown.