Posts

Showing posts with the label ArrayAdapter

It's all about ListViews

     One of the most frequent components used in an android application is a   ListView , it's basically a UI component which displays a list of items (simple String items or richer items), with an   adapter   which can be bound to a   ListView   and a collection of some sort. What do we need in order to create a   ListView ? Two main options: 1. within the context of an Activity which extends the   Activity   Class 2. Within the context of an Activity which extends   ListActivity (that being said if the whole activity is a      list) We’ll look at the first option 1. Create an Activity, and a matching Xml layout file.     In the layout file, add a   ListView   control using   <ListView></ListView> , don't forget to give it        layout_width,layout_height,id.     for example:     <ListView   ...