aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/MoreSuggestionsView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/MoreSuggestionsView.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
index f595510a3..a5ff5330e 100644
--- a/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
@@ -67,7 +67,10 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
@Override
public void onCodeInput(int primaryCode, int[] keyCodes, int x, int y) {
- mListener.onCustomRequest(primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE);
+ final int index = primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE;
+ if (index >= 0 && index < SuggestionsView.MAX_SUGGESTIONS) {
+ mListener.onCustomRequest(index);
+ }
}
@Override