I’m trying to write email address with @ character inside the xml using TextView. I tried using Unicode like someone suggested in the other post asking about ‘&’ character. It didn’t work for @. I tried
<string name="gmail">\u0040 gmail.com</string>
but that returns java.lang.ArrayIndexOutOfBoundsException.
I also tried
<string name="gmail" formatted="false">@gmail.com</string>
but it still gives the same error.
I have no idea how to go about this problem.
Please Help!!
This should do the trick:
@ is, of course, the way you reference identified resources (@+id\textview) which requires escaping to use.
Pretty sure that formatted=”false” does not flag Android to avoid looking up identifiers.