Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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,405 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.