开发者

Ask user for a number / integer value

开发者 https://www.devze.com 2023-03-17 08:09 出处:网络
For a timeout preference I need to ask the user for a number. Is there some kidn of \"number control\" on android or do I have to use a text input and check if the text given by the user if a number?

For a timeout preference I need to ask the user for a number. Is there some kidn of "number control" on android or do I have to use a text input and check if the text given by the user if a number? T开发者_如何学运维hank you very much!


In the graphical layout view for the textbox you can select Properties>Input Type>Number or in the xml view you can add "android:inputType="number"" to the EditText


try this to your edit text field.. this will accept only number..

android:inputType="number"

add this property to your edit text..

0

精彩评论

暂无评论...
验证码 换一张
取 消