How to associate an ImageView with a Class?

0

Although it is something generic, to try to clarify my doubt, I will give an example.

For example, I have a HashMap<Integer, Piece> with size 64, where Integer would be position and Piece, class for a piece of board. And I have a layout with 64 ImageView (Square 8x8), wanting to relate this, ie each ImageView is a Piece and its position a Integer ? How does this association between Views and classes?

    
asked by anonymous 18.11.2017 / 02:49

1 answer

0

You can use the setTag (Object) method of the view to save your map, for example. Check out the View class documentation

    
18.11.2017 / 15:37