How can I set the degree symbol to a TextView
in Android?
Asked
Active
Viewed 4.4k times
52

Steven Byle
- 13,149
- 4
- 45
- 57

narancs
- 5,234
- 4
- 41
- 60
-
You can add/display ANY symbol using (char)
. For finding unicodes of various symbols goto http://www.ssec.wisc.edu/~tomw/java/unicode.html#x2200 – Lakhwinder Singh Dhillon Feb 01 '16 at 15:14
1 Answers
141
The unicode value for it is U+00B0 so you could do the following:
myTextView.setText ( "78" + (char) 0x00B0 );

Ryan Conrad
- 6,870
- 2
- 36
- 36
-
2It is not works, but if i do in the following char tmp = 0x00B0; myTextView.setText(tmp); will be okay! – narancs Aug 10 '10 at 09:59
-
68Simpler would be to use Java's Unicode notation: `"78\u00B0"`, or `char degree = '\u00B0';` – Christopher Orr Jan 04 '11 at 14:57
-
2
-