FileDocCategorySizeDatePackage
ListWithOnItemSelectedAction.javaAPI DocAndroid 5.1 API1528Thu Mar 12 22:22:12 GMT 2015android.widget.listview

ListWithOnItemSelectedAction

public class ListWithOnItemSelectedAction extends android.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());