Fix another crash in Gestures, this one caused by the data file

having the wrong version. I made the loader print a message to
the log for this, and made the calling code disable gestures
for the listview instead of crashing.
This commit is contained in:
Marco Nelissen
2009-05-27 10:01:05 -07:00
parent f0e7e4a946
commit 8ae3f61902
2 changed files with 8 additions and 0 deletions

View File

@@ -153,6 +153,10 @@ public class LetterRecognizer {
case 1:
classifier = readV1(in);
break;
default:
Log.d(LOG_TAG, "Couldn't load handwriting data: version " + version +
" not supported");
break;
}
} catch (IOException e) {

View File

@@ -3864,6 +3864,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
GesturesProcessor() {
mRecognizer = LetterRecognizer.getLetterRecognizer(getContext(),
LetterRecognizer.RECOGNIZER_LATIN_LOWERCASE);
if (mRecognizer == null) {
dismissGesturesPopup();
mGestures = GESTURES_NONE;
}
if (mGestures == GESTURES_FILTER) {
mKeyMap = KeyCharacterMap.load(KeyCharacterMap.BUILT_IN_KEYBOARD);
mHolder = new char[1];