android:imeOptions="actionDone" does not work
2018, Jan 11
There might be many other reason to this. But here I am going to share what I faced and how I fixed it.
Problem:
Let’s consider you want to have an EditText for taking only alpha numeric values as input. So here is an Android XML layout which will cause the error mentioned.
If you observe closely, the EditText has android:digits
attribute for filtering the allowed characters for input. This attribute is the cause behind this problem.
Solution:
So to avoid this problem, you have to add android:singleLine
attribute. Below is the final working XML.
Conclusion:
If we have android:digits
attribute in EditText
, then android:imeOptions
will work ones we add android:singleLine
attribute.