Chapter 9. GUI: ListView

9.1. Introduction: ListView

Ian Darwin


It may seem odd to have a separate chapter for the ListView component. But it is, in fact, one of the most important components, being used in probably 80% of all Android applications. And it is very flexible; you can do a lot with it, but figuring out how to do it is sometimes not as intuitive as it could be.

In this chapter we cover topics from basic ListView uses through to advanced uses.

See the official doc at

Another good overview of ListView can be found in a Google I/O 2010 presentation, which can be found on Google’s YouTube channel, at; this was presented by Google employees Romain Guy and Adam Powell who work on the code for ListView itself.

9.2. Building List-Based Applications with ListView

Jim Blackler


Many mobile applications follow a similar pattern, allowing users to browse and interact with multiple items in a list. How can developers use standard Android UI classes to quickly build an app that works the way users will expect, providing them a list-based view onto their data?


Use a ListView, an extremely versatile control that is well suited to the screen size and control constraints of a mobile application, displaying information in a vertical stack of rows. This recipe shows how to set up a ListView, including rows that contain any combination of standard UI views.

Discussion ...

Get Android Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.