I have an EditText where I only allow $ 0123456789 characters.
Everything works well, except when I press number 4 (on a virtual or hardware keyboard) it prints a dollar sign ($).
Why is this done?
Here is the XML for my EditText:
<EditText android:id="@+id/amount_text" style="@style/textbox" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@null" android:cursorVisible="false" android:digits="$0123456789." android:gravity="left|center_vertical" android:hint="@string/amount_hint" android:inputType="textPhonetic|numberDecimal" />
Secondary Question:
mAmountTxt.setKeyListener(DigitsKeyListener.getInstance(false, true));
This is achieved by what I want (without $). However, it changes the virtual keyboard to what I don't want. I want a phone keypad with large button numbers.
source share