FileDocCategorySizeDatePackage
ListGetSelectedViewTest.javaAPI DocAndroid 5.1 API2044Thu Mar 12 22:22:12 GMT 2015android.widget.listview.touch

ListGetSelectedViewTest

public class ListGetSelectedViewTest extends android.test.ActivityInstrumentationTestCase
This test is made to check that getSelectedView() will return null in touch mode.

Fields Summary
private android.widget.listview.ListGetSelectedView
mActivity
private android.widget.ListView
mListView
Constructors Summary
public ListGetSelectedViewTest()

        super("com.android.frameworks.coretests", ListGetSelectedView.class);
    
Methods Summary
protected voidsetUp()

        super.setUp();

        mActivity = getActivity();
        mListView = getActivity().getListView();
    
public voidtestGetSelectedView()

        View last = mListView.getChildAt(1);
        TouchUtils.clickView(this, last);

        assertNull(mListView.getSelectedItem());
        assertNull(mListView.getSelectedView());
        assertEquals(-1, mListView.getSelectedItemPosition());
    
public voidtestPreconditions()

        assertNotNull(mActivity);
        assertNotNull(mListView);

        assertEquals(0, mListView.getSelectedItemPosition());