summaryrefslogtreecommitdiff
path: root/core/java/android/widget/TextView.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-09-10 18:41:28 -0700
committerDianne Hackborn <hackbod@google.com>2009-09-10 18:41:28 -0700
commit7ed6ee5692c808cf0ebb3ee208fc8ee1314622c2 (patch)
tree15ff43863f4082953a7d854cf467f46416d4ebf6 /core/java/android/widget/TextView.java
parente8f0603eb631ecef5f41105711f4afdea8c6d8d8 (diff)
Fix issue #1983406: Soft keyboard doesn't show up in an EditText with "digits" attribute set
Also pretend to fix #2054990 (com.android.frameworktest: java.lang.NullPointerException at android.accessibilityservice.AccessibilityService$IEventListenerWrapper.executeMessage( AccessibilityService.java:215))... simply by making the variable that apparently was null final, to assure myself that there is no possible way in the world for it to be null. :p Change-Id: I73e337d65b8360721896a0296691257b3e47564b
Diffstat (limited to 'core/java/android/widget/TextView.java')
-rw-r--r--core/java/android/widget/TextView.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index a611d5a9168a..e98fd137954a 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -732,7 +732,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
} else if (digits != null) {
mInput = DigitsKeyListener.getInstance(digits.toString());
- mInputType = inputType;
+ // If no input type was specified, we will default to generic
+ // text, since we can't tell the IME about the set of digits
+ // that was selected.
+ mInputType = inputType != EditorInfo.TYPE_NULL
+ ? inputType : EditorInfo.TYPE_CLASS_TEXT;
} else if (inputType != EditorInfo.TYPE_NULL) {
setInputType(inputType, true);
singleLine = (inputType&(EditorInfo.TYPE_MASK_CLASS