Android always does not eject the software keyboard when clicking on EditText

Source: Internet
Author: User

Scenario Description: Normally, when you click EditText, the soft keyboard will pop up. The requirement now is that when you click EditText, the Date selection dialog box is selected and the results are displayed on EditText. If not, when you click EditText, the Soft Keyboard and dialog will pop up, obviously the user will feel uncomfortable. Solution, when clicked EditText: 1, the storage of the current input type 2, set the input type is inputtype.type_null, prohibit the phone soft keyboard 3, restore the original input type, because this operation is finished, but also allow users to modify. 4, pop-up Date selection dialog box, after the operation, the results are displayed on the EditText. Hide the software disk with the following code:
   This . Findviewbyid (r.id.et_start_time);                 int intype = et_start_time.getinputtype ();                Et_start_time.setinputtype (inputtype.type_null);                  Et_start_time.ontouchevent (event);                Et_start_time.setinputtype (intype);                Et_start_time.setselection (Et_start_time.gettext (). Length ());

http://blog.csdn.net/android_ls/article/details/8642751

Android always does not eject the software keyboard when clicking on EditText

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.