I want to show the "♫" character in an Android TextView, but it shows [] instead.
This is my code:
txtCatname.setText("♫");
How can I display this symbol correctly?
Sometimes you need to add special character as Text in your android app. They are called as Unicode Character. For Android, we have to mention their Unicode number as String and set to textview like Rupee Symbol(₹), bullet, tick mark, star, etc.. Now add textview in your activity_main.
The attribute which is used to change the size of the Text View in android is “textSize”.
You can use an Unicode code: http://unicode-table.com/en/.
Such as:
txtCatname.setText("\u266b");
or alternatively use an iconic font, such as font awesome:
http://fortawesome.github.io/Font-Awesome/
Use this alternative (or any other iconic font you like), in case this character isn't supported (not all Unicode characters are supported).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With