1

i have kept tags for each of the cell inside a GridView. once the gridview is drawn by a custom adapter that i have made, i wish to access one specific cell inside the gridview.

i have tried the following:

view = mygridView.findViewWithTag(tag);

but the view returned is null. how do i access the cell inside the gridview?

thank you in advance.

user590849
  • 11,655
  • 27
  • 84
  • 125
  • You should see this link http://stackoverflow.com/questions/5976533/how-to-find-element-inside-a-gridview-in-android – Radu Dan Sep 23 '11 at 16:02

1 Answers1

1

Try to use gridView.getChildAt(i).findViewWithTag(tag);

Hope it will help.. ;)

Ewoks
  • 12,285
  • 8
  • 58
  • 67
  • in that case would be nice if u accept it as answer ;) my pleasure.. welcome to android wonderland ;) – Ewoks Feb 20 '13 at 20:50
  • i would have accepted but its not my question so i upvoted only :) – Shiv Feb 21 '13 at 04:16
  • can u take a llok to my question and ans?? here is the link http://stackoverflow.com/questions/14994893/gridview-cell-view-position-changes-after-scrolling-color-is-set-to-different – Shiv Feb 21 '13 at 07:21
  • I always get a null using gridView.getChildAt(i), so I can't invoke findViewWithTag(), but my datagrid is filled with an adapter, it has 4 rows/3 columns, which could be the problem? – Windgate Jun 18 '21 at 12:28