* commit '263749f2dc5d1cb885786afbccbb19ae6847c204': Fix IndexOutOfBoundsException
This commit is contained in:
commit
bdbefac0b4
1 changed files with 8 additions and 4 deletions
|
@ -332,8 +332,10 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
|||
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
int index = (Integer) view.getTag();
|
||||
CharSequence word = mSuggestions.getWord(index);
|
||||
final int index = (Integer) view.getTag();
|
||||
if (index >= mSuggestions.size())
|
||||
return true;
|
||||
final CharSequence word = mSuggestions.getWord(index);
|
||||
if (word.length() < 2)
|
||||
return false;
|
||||
addToDictionary(word);
|
||||
|
@ -342,8 +344,10 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
|||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int index = (Integer) view.getTag();
|
||||
CharSequence word = mSuggestions.getWord(index);
|
||||
final int index = (Integer) view.getTag();
|
||||
if (index >= mSuggestions.size())
|
||||
return;
|
||||
final CharSequence word = mSuggestions.getWord(index);
|
||||
if (mShowingAddToDictionary && index == 0) {
|
||||
addToDictionary(word);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue