am 21af9a08: Merge "avoid multiple-"0" to exceed the length of upper bound"

# By Sungmin Choi
# Via Gerrit Code Review (1) and Sungmin Choi (1)
* commit '21af9a08465c4927aab9db30efdfcf5ee8f52410':
  avoid multiple-"0" to exceed the length of upper bound
This commit is contained in:
Adam Powell
2013-02-06 14:58:41 -08:00
committed by Android Git Automerger

View File

@@ -1969,8 +1969,10 @@ public class NumberPicker extends LinearLayout {
* Ensure the user can't type in a value greater than the max
* allowed. We have to allow less than min as the user might
* want to delete some numbers and then type a new number.
* And prevent multiple-"0" that exceeds the length of upper
* bound number.
*/
if (val > mMaxValue) {
if (val > mMaxValue || result.length() > String.valueOf(mMaxValue).length()) {
return "";
} else {
return filtered;