Adapter到底干嘛使的?网上有种说法叫列表适配器接口。那应该就是连接列表视图与数据之间的桥梁了。
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items));
三个参数分别是:
使用的上下文,一般是该activity;
使用的视图的资源ID,android.R.layout.simple_list_item_1, 控制行的现实, The value used in the preceding example provides the standard Android list row: big font, a lot of padding, and white text.
现实的实际数组或列表。
<ListView
android:id="@android:id/list" //????
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
/>
其他适配器:
CursorAdapter: Converts a Cursor, typically from a content provider,
into something that can be displayed in a selection view. (We’ll look at
CursorAdapter in greater detail in Chapter 22, which covers
databases.)