My Activity has an EditText as follows:
<EditText android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="text" android:digits="0123456789.:" />
Allowed entry must be . , : and numbers . But if not allowed char is entered when the EditText empty, the text starts to duplicate.
For example, if EditText empty, enter the following sequence: abc123 .
On my device, the result is 1112123 , but the expected result should be just 123 .
Since this should be as simple as possible, I would not want to use an InputFilter .
source share