I'm trying to use the ⌫ character as my backspace symbol in my android app. When I just copy and paste this character as the text value of my Button it works and shows the symbol in the simulator, but when I try to set this character dynamically in Java or when I try to
use the Basic Latin value of it (\u232b
) it just shows whitespace.
This is when I use the XML editor and my strings.xml
value:
My strings.xml
:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="backSpace">⌫</string>
</resources>
In Java I tried hardcoding it like this, but they all result in whitespace:
((Button) mView.findViewById(R.id.buttonClear)).setText("⌫");
((Button) mView.findViewById(R.id.buttonClear)).setText("\u232b");`
((Button) mView.findViewById(R.id.buttonClear)).setText('\u232b'+"");`
Definitions of backspace character. a control character that indicates moving a space to the left. type of: ASCII control character, control character. ASCII characters to indicate carriage return or tab or backspace; typed by depressing a key and the control key at the same time.
␈ - symbol for backspace (U+2408) - HTML Symbols.
That character is not U+0008. U+0008 is a control character, without a graphical representation.
⌫ is U+232B (the "erase to the left" symbol), so if you use "\u232b"
in your app it should be fine.
Seems like the default Android font (Roboto / droid sans serif) doesn't include this character, so it can't display it (I still haven't figured out how the preview shows it). So you need to find a font that supports this character. The best candidate I've found is Arial Unicode MS, but these work too:
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