How to open numeric keyboard when click on EditText?

血红的双手。 提交于 2019-11-30 07:34:51

add android:inputType="number" to your edittext in your xml, it will automatically open numeric keyboard when you will click inside edittext.

Just you this code for your xml file,

android:inputType="number"
chinben

Add android:inputType="number" in xml will automatically open numeric keyboard when click on EditText, but this will allow you to enter characters only numbers, and if you wanna enter other characters, you may try this:

android:inputType="number"
android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!