views:

466

answers:

1

As a goal for my first Android application to learn the Android SDK, I am trying to create a simple RSS viewer for a specific url. Disregarding the networking side of the goal, I am having trouble with getting a listView to display a custom layout.

What I'd like to do is have each row of a list view show one of two images(read or unread), followed by some text. I'm not really having a problem, it's more that there aren't any examples that I could find (I might be looking in the wrong place) that covered custom layouts depending on conditions in code.

Any help?

+4  A: 

Here is a free excerpt from one of my books that discusses the techniques involved. In a nutshell, you will need to extend your Adapter class (e.g., ArrayAdapter, CursorAdapter) and take direct control over the creation of rows, so you can apply your desired business logic.

CommonsWare
That's exactly what I'm looking for! I'll read through it tomorrow.
GuyNoir
+1 Mark's "Fancy ListViews" also cover all of the ListView optimizations that Romain Guy highlighted during the I/O conference; it is a must read!
Samuh