No, you cannot set id as a string. You can designate integer as Id. You can use setTag() for View with String. But for id, it will be only Integer. Since android resources are supported in R.java file for integer type.
Update:
Why don't you point String or other data types (without integer) id to any android resource?
Because:
The Android Resource Identifier is a 32-bit integer. It contains
an 8-bit Package id [bits 24-31] an 8-bit Type id [bits 16-23] a 16-bit Entry index [bits 0-15]
A packet identifier identifies a packet containing a resource.
The type identifier identifies the type of resource and therefore the corresponding piece of Specpec and the Type chunk or chunks that contain its value or value
The Entry Index identifies a single resource in a Typepec chunk and type type (s).
source share