'Android EditText number pad keyboard with version like filter(TextWatcher)

EditText should accept input like "1.0.1" means multiple "."s. and keyboard should be number pad(I know EditText's inputType should be numberDecimal).

enter image description here

But numberDecimal only accepts single dot and the filter won't work for this. How to solve this???



Solution 1:[1]

I think you could just add . to EditText android:digits xml value

Like so :

<EditText
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:digits="0123456789."
   android:inputType="numberDecimal" 
/>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sabriael