Try the following:
weightInput.setInputType(InputType.TYPE_CLASS_NUMBER); weightInput.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL); weightInput.setKeyListener(DigitsKeyListener.getInstance(false,true));
public static DigitsKeyListener getInstance (boolean sign, boolean decimal)
Returns a DigitsKeyListener that accepts digits from 0 to 9, plus a minus sign (only at the beginning) and / or a decimal point (only one per field), if specified.
This solves the problem of many ".". in EditText
JoeyRA Feb 06 '14 at 12:37 2014-02-06 12:37
source share