Android edittext imeoption

Source: Internet
Author: User

After the SDK is upgraded to 1.5, when the text input box (edittext and its subclass) gets the focus, the system's built-in Soft Keyboard will pop up.
In order to implement some custom functions, I have studied a little bit

* When layout has multiple edittexts and the Android: singleline attribute of each control is set to true, the text on the Enter key of the Soft Keyboard will change to "Next ", press next edittext to automatically obtain the focus (implementing the "Next" function). When the last control gets the focus, the text on the Enter key will become "done ", the keyboard is automatically hidden after you press it.

* Set the ime options attribute of edittext to different values. Different texts or patterns can be displayed on the Enter key.
Actionnone: Enter key. Press the button and move the cursor to the next line.
Actiongo: Go,
Actionsearch: a magnifier
Actionsend: Send
Actionnext: Next
Actiondone: done to hide the keyboard, even if it is not the last text input box

* Set the onkeylistener of the text box. When the keycode is 66, it indicates that the Enter key is pressed and you can write the desired action.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.