FileDocCategorySizeDatePackage
ListWithOnItemSelectedAction.javaAPI DocAndroid 1.5 API1557Wed May 06 22:42:02 BST 2009com.android.frameworktest.listview

ListWithOnItemSelectedAction

public class ListWithOnItemSelectedAction extends com.android.frameworktest.util.ListScenario
The header text view echos the value of the selected item by using (indirectly) the {@link android.widget.AdapterView.OnItemSelectedListener}.

Fields Summary
Constructors Summary
Methods Summary
protected voidinit(Params params)

        params.setNumItems(8)
                .setItemScreenSizeFactor(0.2)
                .includeHeaderAboveList(true);

    
protected voidpositionSelected(int positon)

        if (positon != getListView().getSelectedItemPosition()) {
            throw new IllegalStateException("something is fishy... the selected postion does not " +
                    "match what the list reports.");
        }
        setHeaderValue(
                ((TextView) getListView().getSelectedView()).getText().toString());