]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Fix off-by-one error.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index bb749f82fc333ba587d07a9ce7cc2f226c343cbf..e0290b065eb1e8cc057e5091c6cdc170494df368 100644 (file)
@@ -777,7 +777,7 @@ public class DictionaryActivity extends ActionBarActivity {
             }
         } else {
             // Down
-            destIndexEntry = Math.min(tokenRow.referenceIndex + 1, index.sortedIndexEntries.size());
+            destIndexEntry = Math.min(tokenRow.referenceIndex + 1, index.sortedIndexEntries.size() - 1);
         }
         final Index.IndexEntry dest = index.sortedIndexEntries.get(destIndexEntry);
         Log.d(LOG, "onUpDownButton, destIndexEntry=" + dest.token);