SHARE
TWEET

Untitled

a guest Jun 17th, 2012 57 Never
  1. How to find element inside a gridview in Android?
  2. gridviewobject.findViewById(thetag);
  3. // gridview object is the object of the gridview that i have populated.
  4.        
  5. final int numVisibleChildren = gridView.getChildCount();
  6. final int firstVisiblePosition = gridView.getFirstVisiblePosition();
  7.  
  8. for ( int i = 0; i < numVisibleChildren; i++ ) {
  9.     int positionOfView = firstVisiblePosition + i;
  10.  
  11.     if (positionOfView == positionIamLookingFor) {
  12.         View view = gridView.getChildAt(i);
  13.     }
  14. }
RAW Paste Data
Top