1

I am trying to add a DONE key to the soft keyboard so that it will hide when the user is done adding text to an EditText.

The thing is that, from other answers here, I saw that adding the following to the XML file will do the thing:

 android:imeOptions="actionDone"
 android:singleLine="true"

It actually WORKS fine, and the DONE key is showed....however, Android Studio is complaining, telling that android:singleLine="true" is deprecated, use maxLines = 1.

Well, if I change android:singleLine="true" with maxLines = 1 it DOES NOT WORK and the DONE key is not showed.

Am I missing something here?? (Android Studio 2.3.3 I am using)

codeKiller
  • 5,493
  • 17
  • 60
  • 115

1 Answers1

2

android:singleLine is Deprecated .You should use maxLines with inputType .

android:imeOptions="actionDone"
android:maxLines="1"
android:inputType="text"
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198