1 and 5 are cheeses.
Each item is a single line.
10 and 11 are also single-line items,
with radio buttons and check boxes.
See also
Each item in 4 and 6 is a LinearLayout containing two TextViews. Each item in 8 is an ImageView.
2 reads from Contacts,
12 from an EditText
.
9 and 13 have OnScrollListeners. Is scrolling in progress? Where have we scrolled to? How much of the total list is currently visible?
List1.java
:
cheeses of the world.
setTextFilterEnabled
lets you type.List2.java
:
read the contacts database.
Put a
Cursor
into a
SimpleCursorAdapter
.List3.java
:
read the contacts database.
More complicated than ¶ 2.
List4.java
.
Each item in the list is a
LinearLayout
containing two
TextView
s
(one-line title and big body).
Quotes from Shakespeare.
notifyDataSetChanged
tells the view to redraw itself.
List5.java
.
The cheeses in ¶ 1 with rows of dashes.
----------
List6.java
.
The
LinearLayout
s in ¶ 4.
Display the one-line title and pop up the body.
setVisibility
makes a view invisible.
notifyDataSetChanged
.
notifyDataSetChanged
tells the adapter to tell the
ListView
to redraw itself.
List8.java
.
Each line in the TableView is an
ImageView
.
List9.java
.
The cheeses in ¶ 1,
with their initials displayed in a
Toast
.
The
ListActivity
implements the interface
ListView.OnScrollListener
and has the method
onScroll
.
List10.java
.
A radio button on each line.
The file
/Users/myname/Downloads/android-sdk-mac_x86/platforms/android-11/data/res/layout/simple_list_item_single_choice.xml
CheckedTextView
with the property
android:checkMark="?android:attr/listChoiceIndicatorSingle"
.List11.java
.
A check box on each line.
The file
/Users/myname/Downloads/android-sdk-mac_x86/platforms/android-11/data/res/layout/simple_list_item_multiple_choice.xml
CheckedTextView
with the property
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
.List12.java
.
Call the
add
method of the
ArrayAdapter
to add another line.
List13.java
.
The
ListActivity
implements the interface
ListView.OnScrollListener
.
Status line at the bottom tells you when the list is busy scrolling.
List14.java
.
Adapter recycles the views.