Comparing a view's tag to an integer

android, compare, integer, tags

Solution

I think your Tag is rather a String than an Integer.

If that's the case convert your Integer toString() and check if it equals().

Problem

I'm trying to compare an array of integers to the tags of imageviews I have uniquely made. using this line: ``` if(grid[i][j] == buttons[k].getTag()){ ``` I know im on the right tracks, but I can't figure out if i need to cast it or use a method. I know its a simple question, but any help would be greatly appreciated, thanks.

Original source