Android click EditText and the software keyboard implementation code will never pop up

Android click EditText and the software keyboard will never pop up

Scenario Description: under normal circumstances, when you click EditText, the soft keyboard will pop up. The current requirement is that when you click EditText, the date selection dialog box will pop up, and the selection result will be displayed on EditText. If you don't handle it, when you click EditText, the soft keyboard and dialog box will pop up. Obviously, users will feel uncomfortable.

Solution: when you click EditText:

1. Store the current input type 2. Set the input type to inputtype TYPE_ Null, disable the mobile phone soft keyboard. 3. Restore the original input type, because the user is allowed to modify after this operation. 4. The date selection dialog box pops up. After the operation, the results will be displayed on EditText.

Hide the software disk. The code is as follows:

Thank you for reading, hope to help you, thank you for your support to this site!

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
分享
二维码
< <上一篇
下一篇>>