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!
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
Jeffrey Kwok3,006 Points
I'm having difficulty parsing a JSON file onto a listview for a personal project
Background: I'm trying to parse a JSON file into a listview. I've been following the "Building the Weather app" and "listview &adapter" tutorials and trying to apply those lessons into my project
Problem: I'm at the parcelable section of the tutorial and I'm having difficultly applying it into my project. My project is different from the weather app because it only has one list and no buttons. I'm having trouble passing information from my adapter to the MainActivity and I would appreciate any advice. Thank you
json file: https://core.ac.uk/api-v2/articles/search/cells?page=1&pageSize=20&metadata=true&fulltext=false&citations=false&similar=false&duplicate=false&urls=true&faithfulMetadata=false&apiKey=PykSKLeJz7ZldYQbNWoTDvwCfnarFXOg
Seth Kroger56,412 Points
You only really need to make something Parcelable if you're passing it through an Intent or Bundle. Since you only have the one Activity so far, it's not really needed. Really all you need to do is store the resulting data a member variable in MainActivity and create the Adapter passing along the list of parsed data.