4.3.2. ListActivity
When an Activity’s primary task is to display a scrollable list of items, you can extend class ListActivity (package android.app), which uses a ListView that occupies the entire app as its default layout. ListView is a subclass of AdapterView (package android.widget)—a GUI component is bound to a data source via an Adapter object (package android.widget). In this app, we use an ArrayAdapter (package android.widget) to create an object that populates the ListView using data from an ArrayList collection object. This is known as data binding. Several types of AdapterViews can be bound to data using an Adapter. In Chapter 8, you’ll learn how to bind database data to a ListView. For more details on data binding in Android and several ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access