I have simple layout, but I can only set string tag. How to set integer tag?
From the author's edit I attempted to use @integer/int2 to set the tag as an integer, but it still seems that getTag() is returning the tag as a String (at least in Jellybean). Integer.parseInt(String) can convert a String to an Integer and @integer/int2 can validate that your tag is a proper Integer. So if you want to put an Integer in a tag through XML that is probably the best route. Downside, since it uses parseInt it likely takes a little more time than having it stored as a int the whole time.