summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@android.com> 2013-02-06 15:00:44 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2013-02-06 15:00:44 -0800
commit044a4c3e4a42aae4faac8b92ea05f122cdf45f7c (patch)
treeb19f722ba2cb08b78f75f65f6d09dc3b62387dd3
parent11f1c5b89a98cb6794f2b1f158b8c22e38af975f (diff)
parent351f7817e555f52571e72751bb452a715495f010 (diff)
am 351f7817: am 21af9a08: Merge "avoid multiple-"0" to exceed the length of upper bound"
# By Sungmin Choi # Via Android Git Automerger (1) and others * commit '351f7817e555f52571e72751bb452a715495f010': avoid multiple-"0" to exceed the length of upper bound
-rw-r--r--core/java/android/widget/NumberPicker.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 74ded18b64ed..2ac5a128598e 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -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;