The layout classes covered so far are primarily graphical and their use is mainly design oriented, but there are layout classes that we can connect to various data structures such as the ListView and the GridView, both of which extend the base AbsListView class.
Here we will need to define a string array to populate our list as well as construct a ListAdapter to bind our data to our views. Start a new project with Eclipse and open the res/values/strings.xml
file.
Select the strings.xml tab and include the following string array so that the whole file matches the one here:
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello World, ListViewsAndAdapters!</string> <string name="app_name">ListViewsAndAdapters</string> <string-array name="cities"> <item>Bath</item> <item>Birmingham</item> <item>Bradford<...