Is it possible to use more then 1 imeOptions
in Android xml ? for the same text field
.
e.g.
<EditText
android:id="@+id/mywriting"
android:imeOptions="actionDone"
android:imeOptions="autoText"/>
Right now it is giving me an error, saying 1 imeOptions has already been used
and I can't use any more
Use | to combine, like that:
android:imeOptions="actionDone|actionNext"
In your case, the problem is with autoText, which is not a valid value for imeOptions
.
Hey guys i've seen your post while checking for an issue, which is the following:
When applying 2 IME options within the XML it works:
tools:imeOptions="actionDone|actionPrevious"
//Even tools:imeOptions="actionPrevious|actionNext" will work
When doing so: by default, the Ime shown will be the "DONE" (OR "NEXT" when using previous/next), but if you remain pressed some seconds on it, the "PREVIOUS" button is shown and then if you release the "DONE" button it will perform the "PREVIOUS" IME action... Whatever the options order.
Smartest thing is that... if you do the same by code:
myEditText.setImeOptions(EditorInfo.IME_ACTION_DONE|EditorInfo.IME_ACTION_PREVIOUS);
Then it doesn't work: you get only the "PREVIOUS" button
EDIT OK this was a bad practice: if you wish to use Previous/Next, better is to remove ImeOptions and replace by :
android:nextFocusUp="@id/layoutItemId" //Previous view to focus
android:nextFocusDown="@id/layoutBBDate" //next view to focus
If you wish to use "Previous/Done" declare:
android:nextFocusUp="@id/layoutItemId" //Previous view to focus
tools:imeOptions="actionDone"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With