From 8a37e6190bd2c6116979b7827ec0e267cec9d571 Mon Sep 17 00:00:00 2001 From: Charles Chen Date: Thu, 4 Feb 2010 15:52:30 -0800 Subject: [PATCH] Fixing bug 2418114. Added a check to make sure the TTS sample string for a language-country combination is available before trying to use it. --- src/com/android/settings/TextToSpeechSettings.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/TextToSpeechSettings.java b/src/com/android/settings/TextToSpeechSettings.java index 838d9786b04..1a97fbf189f 100644 --- a/src/com/android/settings/TextToSpeechSettings.java +++ b/src/com/android/settings/TextToSpeechSettings.java @@ -425,7 +425,9 @@ public class TextToSpeechSettings extends PreferenceActivity implements // update the demo string mDemoStringIndex = mDefaultLocPref.findIndexOfValue(mDefaultLanguage + LOCALE_DELIMITER + mDefaultCountry); - mDefaultLocPref.setValueIndex(mDemoStringIndex); + if (mDemoStringIndex > -1){ + mDefaultLocPref.setValueIndex(mDemoStringIndex); + } } /**