I'd like to allow possible inputs of 0-9, "," or "-" for EditText and couldn't find an answer.
I know using the "|" as an separator is possible:
android:inputType="number|text"
But how can I archive something like this (too bad it doesn't work):
android:inputType="number|,|-"
Does anyone know?
Regards,
cody
Addition to the comment below:
private class MyKeylistener extends NumberKeyListener {
public int getInputType() { return InputType.TYPE_CLASS_NUMBER; } @Override protected char[] getAcceptedChars() { return new char[] {'0','1','2','3','4','5','6','7','8','9',',','-'}; }
}