ActionDone imeOption not working on EditText in Android 2.3

I have a problem using EditText in Android 2.3.

I have an EditText defined using the android:imeOptions="actionDone" , but when I write with the virtual keyboard, the return key does not detect the actionDone and enters the return line.

In Android 2.2 it works correctly.

 <EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:imeOptions="actionDone" /> 
+42
android android-edittext
Apr 7 2018-11-11T00:
source share
4 answers

I solved this problem. I added the android:singleLine="true" property android:singleLine="true" and it works correctly.

 <EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:imeOptions="actionDone" android:singleLine="true" /> 
+119
Apr 7 2018-11-11T00:
source share

Another noteworthy point of view is that android:imeOptions do not work if you specify android:digits . Not sure if this affects all versions of Android.

+8
May 6 '13 at 9:42
source share

Currently in Android Studio 2.2.3 if you are using

 android:singleLine="true" 

The IDE gives a warning that it is deprecated using maxlines instead.

 android:maxLines="1" 

However maxLines does not solve the problem. The solution is to simply add the inputType attribute. Example:

 <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/actionDoneDemo" android:layout_below="@id/nameET" android:imeOptions="actionDone" android:hint="Action Done Demo" android:inputType="text"/> 
0
Feb 02 '17 at 2:47 on
source share

just specify inputType .

he works with me

-2
Nov 10 '17 at 6:38
source share



All Articles