I have two kinds of edittext that I use to calculate, and both of them should be limited by numbers, so I use InputType for this, but now I can not enter a negative number or any numbers containing decimal places!
Any ideas or solutions?
Thanks!
You must use numberSigned or numberDecimal , or both numberDecimal|numberSigned , to enable the necessary functions.
numberSigned
numberDecimal
numberDecimal|numberSigned
Just use below and even the device input keyboard will only contain numbers:
myTextView.setInputType( InputType.TYPE_CLASS_NUMBER);