From 6233ee3633da9489e29bcf86327af28249bd1834 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 14 Jun 2013 12:40:35 +0900 Subject: [PATCH] Fix a bug with long user dict entries Bug: 9410958 Change-Id: I966e452c6dbdcb444abbb6ffb316849a7c85a73b --- .../latin/userdictionary/UserDictionaryAddWordContents.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java index 2b6fda381..89ec7466e 100644 --- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java +++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java @@ -76,7 +76,9 @@ public class UserDictionaryAddWordContents { final String word = args.getString(EXTRA_WORD); if (null != word) { mWordEditText.setText(word); - mWordEditText.setSelection(word.length()); + // Use getText in case the edit text modified the text we set. This happens when + // it's too long to be edited. + mWordEditText.setSelection(mWordEditText.getText().length()); } final String shortcut; if (UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {