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