TextView allowing only numbers

0

I want my TextView only accepted as input numbers, however the line android:numeric="decimal" has no effect, it still allows me to type letters.

    
asked by anonymous 25.06.2015 / 00:15

1 answer

3

To allow only numbers you should set within your EditText this way:

android:inputType="number"

Another way would be:

<EditText android:id="@+id/myNumber"
 android:digits="0123456789." 
 android:inputType="numberDecimal"/>
    
25.06.2015 / 00:17