I have used this Unicode character U+2300. But its not reflection in Android Textview. I have used it in both xml layout and in java class.
Asked
Active
Viewed 1,226 times
0
-
how did you use that character, and what was the result? – Vladyslav Matviienko Dec 03 '18 at 09:27
-
You may find answer here https://stackoverflow.com/a/4522563/2641380 – SHS Dec 03 '18 at 09:27
-
@VladyslavMatviienko its showing same as U+2300. But it should show it as diameter symbol. – Anshul Dec 05 '18 at 11:05
2 Answers
0
Try this.
String str = "\u2300";
textView.setText(str);

Sabyasachi
- 3,499
- 2
- 14
- 21
-
2Just blurting out code without explanation is not what Stack Overflow is about. [Take the Tour](https://stackoverflow.com/tour) and [How to write a good answer](https://stackoverflow.com/help/how-to-answer) – Rob Dec 03 '18 at 13:37
0
Encodings of Unicode Character 'DIAMETER SIGN'
HTML Entity (decimal) ⌀
HTML Entity (hex) ⌀
How to type in Microsoft Windows Alt +2300
UTF-8 (hex) 0xE2 0x8C 0x80 (e28c80)
UTF-8 (binary) 11100010:10001100:10000000
UTF-16 (hex) 0x2300 (2300)
UTF-16 (decimal) 8,960
UTF-32 (hex) 0x00002300 (2300)
UTF-32 (decimal) 8,960
C/C++/Java source code "\u2300"
Python source code u"\u2300"
In Android, you can not use this Unicode directly in your text view tag, but first you have to store the string value in your string.xml file and then use it from there
EX.
<string name="save">SAVE \u2300</string>
<TextView
android:id="@+id/btnSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/save"/>
Output :

Prince Dholakiya
- 3,255
- 27
- 43
-
1when the `strings.xml` is saved in UTF-8 encoding, it should even work with the literal symbol; notice the tiny indicator in Android Studio; at the bottom of the editor window. – Martin Zeitler Dec 03 '18 at 10:36