FileDocCategorySizeDatePackage
ListWithOnItemSelectedActionTest.javaAPI DocAndroid 5.1 API2172Thu Mar 12 22:22:12 GMT 2015android.widget.listview.arrowscroll

ListWithOnItemSelectedActionTest

public class ListWithOnItemSelectedActionTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
private android.widget.ListView
mListView
Constructors Summary
public ListWithOnItemSelectedActionTest()

        super("com.android.frameworks.coretests", ListWithOnItemSelectedAction.class);
    
Methods Summary
private java.lang.StringgetValueOfSelectedTextView()

        return ((TextView) mListView.getSelectedView()).getText().toString();
    
protected voidsetUp()

        super.setUp();
        mListView = getActivity().getListView();
    
public voidtestHeaderEchoesSelectionAfterMove()

        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);

        assertEquals(1, mListView.getSelectedItemPosition());
        assertEquals("header text field should be echoing contents of selected item",
                getValueOfSelectedTextView(),
                getActivity().getHeaderValue());
    
public voidtestPreconditions()

        assertEquals(0, mListView.getSelectedItemPosition());
        assertEquals("header text field should be echoing contents of selected item",
                getValueOfSelectedTextView(),
                getActivity().getHeaderValue());