Search code examples
androidpreference

Ask user for a number / integer value


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? Thank you very much!


Solution

  • 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