you only need one onTouchListener... iterate all the children of the grid, assign the same listener to them all, also assign each child a specific tag that marks it (can be a class that holds it's x,y coordinates, a unique name that does that, whatever floats your boat). Then when the touch event is called, you can get the Sender's Tag and figure out who was pressed.
You can also do the same without tags if you assign unique IDs to each child view. On Monday, July 1, 2013 11:13:50 AM UTC+3, Shadab Khatib wrote: > > I am trying to prepare a screen interface which has a grid like sudoku or > any word placing game, with many ontouch listeners. But when I use the > grid layout there are just many number of rows and columns and I am not > able to understand how to access specific set of ontouch listener points. > Can any one assists me by telling me how to set atleast one point on the > grid layout to use? > -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.