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 Weather App (2015) Working with JSON Setting the Weather Icon

Alex Londono
Alex Londono
2,033 Points

I have a weird error. My program runs but the error still shows up.

D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true D/Atlas: Validating map... I/OpenGLRenderer: Initialized EGL, version 1.4

              [ 12-16 06:24:24.750 13564:13617 D/         ]
              HostConnection::get() New Host Connection established 0x7fbd087ac240, tid 13617

D/OpenGLRenderer: Enabling debug mode 0 W/EGL_emulation: eglSurfaceAttrib not implemented W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fbd087ac840, error=EGL_SUCCESS E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000b44 E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0 V/digital_msg_board: {"latitude":43.8054259,"longitude":-79.5540045,"timezone":"America/Toronto","offset":-5,"currently":{"time":1481887469,"summary":"Partly Cloudy","icon":"partly-cloudy-night","nearestStormDistance":43,"nearestStormBearing":69,"precipIntensity":0,"precipProbability":0,"temperature":11.83,"apparentTemperature":6.07,"dewPoint":7.12,"humidity":0.81,"windSpeed":3.23,"windBearing":235,"visibility":7,"cloudCover":0.4,"pressure":1024.32,"ozone":319.86},"minutely":{"summary":"Partly cloudy for the hour.","icon":"partly-cloudy-night","data":[{"time":1481887440,"precipIntensity":0,"precipProbability":0},{"time":1481887500,"precipIntensity":0,"precipProbability":0},{"time":1481887560,"precipIntensity":0,"precipProbability":0},{"time":1481887620,"precipIntensity":0,"precipProbability":0},{"time":1481887680,"precipIntensity":0,"precipProbability":0},{"time":1481887740,"precipIntensity":0,"precipProbability":0},{"time":1481887800,"precipIntensity":0,"precipProbability":0},{"time":1481887860,"precipIntensity":0,"precipProbability":0},{"time":1481887920,"precipIntensity":0,"precipProbability":0},{"time":1481887980,"precipIntensity":0,"precipProbability":0},{"time":1481888040,"precipIntensity":0,"precipProbability":0},{"time":1481888100,"precipIntensity":0,"precipProbability":0},{"time":1481888160,"precipIntensity":0,"precipProbability":0},{"time":1481888220,"precipIntensity":0,"precipProbability":0},{"time":1481888280,"precipIntensity":0,"precipProbability":0},{"time":1481888340,"precipIntensity":0,"precipProbability":0},{"time":1481888400,"precipIntensity":0,"precipProbability":0},{"time":1481888460,"precipIntensity":0,"precipProbability":0},{"time":1481888520,"precipIntensity":0,"precipProbability":0},{"time":1481888580,"precipIntensity":0,"precipProbability":0},{"time":1481888640,"precipIntensity":0,"precipProbability":0},{"time":1481888700,"precipIntensity":0,"precipProbability":0},{"time":1481888760,"precipIntensity":0,"precipProbability":0},{"time":1481888820,"precipIntensity":0,"precipProbability":0},{"time":1481888880,"precipIntensity":0,"precipProbability":0},{"time":1481888940,"precipIntensity":0,"precipProbability":0},{"time":1481889000,"precipIntensity":0,"precipProbability":0},{"time":1481889060,"precipIntensity":0,"precipProbability":0},{"time":1481889120,"precipIntensity":0,"precipProbability":0},{"time":1481889180,"precipIntensity":0,"precipProbability":0},{"time":1481889240,"precipIntensity":0,"precipProbability":0},{"time":1481889300,"precipIntensity":0,"precipProbability":0},{"time":1481889360,"precipIntensity":0,"precipProbability":0},{"time":1481889420,"precipIntensity":0,"precipProbability":0},{"time":1481889480,"precipIntensity":0,"precipProbability":0},{"time":1481889540,"precipIntensity":0,"precipProbability":0},{"time":1481889600,"precipIntensity":0,"precipProbability":0},{"time":1481889660,"precipIntensity":0,"precipProbability":0},{"time":1481889720,"precipIntensity":0,"precipProbability":0},{"time":1481889780,"precipIntensity":0,"precipProbability":0},{"time":1481889840,"precipIntensity":0,"precipProbability":0},{"time":1481889900,"precipIntensity":0,"precipProbability":0},{"time":1481889960,"precipIntensity":0,"precipProbability":0},{"time":1481890020,"precipIntensity":0,"precipProbability":0},{"time":1481890080,"precipIntensity":0,"precipProbability":0},{"time":1481890140,"precipIntensity":0,"precipProbability":0},{"time":1481890200,"precipIntensity":0,"precipProbability":0},{"time":1481890260,"precipIntensity":0,"precipProbability":0},{"time":1481890320,"precipIntensity":0,"precipProbability":0},{"time":1481890380,"precipIntensity":0,"precipProbability":0},{"time":1481890440,"precipIntensity":0,"precipProbability":0},{"time":1481890500,"precipIntensity":0,"precipProbability":0},{"time":1481890560,"precipIntensity":0,"precipProbability":0},{"time":1481890620,"precipIntensity":0,"precipProbability":0},{"time":1481890680,"precipIntensity":0,"precipProbability":0},{"time":1481890740,"precipIntensity":0,"precipProbability":0},{"time":1481890800,"precipIntensity":0,"precipP I/digital_msg_board: From Json: America/Toronto E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.example.myyads, PID: 13564 java.lang.NullPointerException: id == null at java.util.TimeZone.getTimeZone(TimeZone.java:349) at com.example.myyads.CurrentWeather.getFormattedTime(CurrentWeather.java:95) at com.example.myyads.digital_msg_board.getCurrentDetails(digital_msg_board.java:132) at com.example.myyads.digital_msg_board.access$100(digital_msg_board.java:27) at com.example.myyads.digital_msg_board$1.onResponse(digital_msg_board.java:65) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) E/eglCodecCommon: **** ERROR unknown type 0x0 (glSizeof,73) E/eglCodecCommon: **** ERROR unknown type 0x0 (glSizeof,73) E/eglCodecCommon: **** ERROR unknown type 0x0 (glSizeof,73) I/art: Background sticky concurrent mark sweep GC freed 24187(1028KB) AllocSpace objects, 4(142KB) LOS objects, 29% free, 2MB/3MB, paused 98us total 122.768ms E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000b44 E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0 E/eglCodecCommon: **** ERROR unknown type 0x0 (glSizeof,73) E/eglCodecCommon: **** ERROR unknown type 0x0 (glSizeof,73) E/eglCodecCommon: **** ERROR unknown type 0x0 (glSizeof,73)

Alex Londono
Alex Londono
2,033 Points

And why the heck does only the very top show up in a nice color text box while the vast majority is in plain text? The error is confusing enough as it is. Having it without color coding isn't going to help. I also want to figure this out for many future questions I post on this site.

1 Answer

Seth Kroger
Seth Kroger
56,414 Points

From the error you aren't pulling the timezone info out of the response correctly, at the very least. Seeing your code would be helpful. The Markdown Cheatsheet explains how to format it in your posts.

Alex Londono
Alex Londono
2,033 Points

To see my code, do you want me to post my files, email them, take a photo or just show you where the files are on my github? https://github.com/alexlondono/MyYads

Thank you,

Seth Kroger
Seth Kroger
56,414 Points

GitHub is perfect.

You do extract the timezone but forget to set it on the CurrentWeather object (line 122-132)

Alex Londono
Alex Londono
2,033 Points

Thank you very much SethKroger :) I got it working.