Skip to content

Lots of Lists: Part 2, List with custom objects and adapter

Putting it all together

We’ve defined the project, layouts, objects, and adapter. Now that we have our new tools, we need to put them together to achieve our goal.

In order to make use of our new adapter, we’ll need to go back to our original Activity. We need to do the following:

  • Reference the ListView in the MainActivity
  • Bind the ListView to the NewsEntryAdapter
  • Populate the NewsEntryAdapter with NewsEntry objects

Here is the code we came up with:

And that’s it! There are a lot more options to explore with ListViews and Adapters not covered here (yet.)

Download this project now: [ Git | ZIP ]

Consider leaving a comment if you would like to see other details covered from this article, any mistakes, or general questions. Thanks for reading!

{ 5 } Comments