I have following EditText
element, when the keyboard shows up to enter value here there is a -
sign shown there but nothing happens when you click it? can anyone tell me why.
<EditText
android:id="@+id/kernelb11"
android:layout_width="@dimen/matrixBoxWidthHeight"
android:layout_height="@dimen/matrixBoxWidthHeight"
android:layout_below="@+id/textViewb"
android:layout_margin="@dimen/marginOne"
android:background="@color/white1"
android:gravity="center"
android:inputType="number"
android:maxLength="2"
android:text="0" >
android:inputType="numberSigned"
and it should work.
if input type
as number
then - sign
will not be accepted, so you need to use input type
as numberSigned
like
android:inputType="numberSigned"
or
android:inputType="text"
android:digits="0123456789-"
inside EditText
android:inputType="number"
A numeric only field. Corresponds to TYPE_CLASS_NUMBER
| TYPE_NUMBER_VARIATION_NORMAL
.
use
android:inputType="numberSigned"
Can be combined with number and its other options to allow a signed number. Corresponds to TYPE_CLASS_NUMBER | TYPE_NUMBER_FLAG_SIGNED.
Docs
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