Code example for GridView

Methods: getSelectedItemPosition

0
    @MediumTest 
    public void testPreconditions() { 
        assertNotNull(mActivity);
        assertNotNull(mGridView);
 
        assertEquals(0, mGridView.getSelectedItemPosition());
    } 
 
    @MediumTest 
    public void testNoScroll() { 
        View firstChild = mGridView.getChildAt(0);
        View lastChild = mGridView.getChildAt(mGridView.getChildCount() - 1);
         
        int firstTop = firstChild.getTop();
         
        TouchUtils.dragViewBy(this, lastChild, Gravity.TOP | Gravity.LEFT, 
                0, -(ViewConfiguration.getTouchSlop()));
         
        View newFirstChild = mGridView.getChildAt(0);
         
Stop searching for code, let great code find you!  Add Codota to your java IDE