Is there a way to clamp the numerical value entered into a editTextPreference? I’d like to limit a value to say +- 45.
Is there a way to clamp the numerical value entered into a editTextPreference? I’d
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In addition to setting android:inputType=”numberSigned”, you would need to setup a KeyListener, or TextWatcher, to enforce the min/max values.
Alternatively, you may want to look into one of the existing views that are intended for this type of limited input, such as NumberPicker