Solution to invalid imeoptions set by EditText in Android

Sometimes we need to change to "go" or "go to search" in the lower right corner of the keyboard after the EditText is output. Usually, we need to set the Android: imeoptions property. The values of Android: imeoptions include actiongo, actionsend, actionsearch, actiondone, etc

But today I found that the setting is invalid because I set Android: maxlines = "1"

The solution is to remove Android: maxlines = "1" setting Android: singleline = "true" and set inputtype to text if necessary

There is a way to listen to click enter search on the Internet. This way of writing will be executed twice. The solution is

The solution is 1 (PS this method is a little redundant)

There is another way to write it: directly listen to ActionID, which is equal to the time required for search

The above is the solution to the invalid problem of EditText setting imeoptions in Android introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>