Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdbefac0 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android Git Automerger
Browse files

am 263749f2: am 37deb112: Fix IndexOutOfBoundsException

* commit '263749f2':
  Fix IndexOutOfBoundsException
parents 08c85e8a 263749f2
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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 {