FileDocCategorySizeDatePackage
ListGetSelectedViewTest.javaAPI DocAndroid 1.5 API2059Wed May 06 22:42:02 BST 2009com.android.frameworktest.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 com.android.frameworktest.listview.ListGetSelectedView
mActivity
private android.widget.ListView
mListView
Constructors Summary
public ListGetSelectedViewTest()

        super("com.android.frameworktest", 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());