After Chapters 26 and 27, I’ve been trying to get in a bit of extra practice with AsyncTask and HandlerThread by tweaking some of the code that I’ve built up so far with the book. I’m having a bit of difficulty actually extracting the JSON bits and pieces that I actually want and then storing them into the data model. I’m getting no critical errors on compile, and yet the model just isn’t getting any new objects.
I’ve made quite a few changes in the main fragment:
I’ve also added a class to help parse JSON:
In LogCat, the “AsyncTaskParseJson.java” tag reveals a System.err that’s preventing any info from getting put into the model. Could there be a problem with my helper class or AsyncTask? Am I missing any tweaks to the rest of the code? Am I just not interpreting the JSON from reddit.com/r/adviceanimals.json correctly? Please help, an extra pair of more experienced eyes would be greatly appreciated!