private Current getCurrentDetails(String weatherData) throws JSONException { // Need a try catch block to fix the error when you first do this // OR WE CAN THROW AN EXCEPTION IN THE METHOD DECLARATION!! // ~ TO MAKE THE throws WORK, WE NEED TO CATCH THE EXCEPTION IN THE TRY CATCH BLOCK ABOVE IN THE // MAIN CLASS JSONObject forecast = new JSONObject(weatherData); // Creates a JSONObject instance to work with the JSON data String timezone = forecast.getString("timezone"); Log.i(TAG, "The timezone from JSON is: " + timezone); JSONObject currently = forecast.getJSONObject( "currently"); // Gets the whole JSON "currently" object for you to parse through Current current = new Current(); // Declares a Current object to set values for WITH THE JSON object's // (currently) data current.setHumidity(currently.getDouble("humidity")); current.setPrecipChance(currently.getDouble("precipProbability")); current.setIcon( currently.getString("icon")); // Retrieves the icon value for our mIcon in Current current.setSummary(currently.getString("summary")); current.setTemperature(currently.getDouble("temperature")); current.setTime( (currently.getLong( "time"))); // Pulling all these values from JSON keys and setting our Current's mVars current.setTimeZone(timezone); current.setWind((currently.getInt("windSpeed"))); Log.d(TAG, current.getFormattedTime()); return current; }