OSDN Git Service

Fixing bug 2418114. Added a check to make sure the TTS sample string for
authorCharles Chen <clchen@google.com>
Thu, 4 Feb 2010 23:52:30 +0000 (15:52 -0800)
committerCharles Chen <clchen@google.com>
Thu, 4 Feb 2010 23:52:30 +0000 (15:52 -0800)
a language-country combination is available before trying to use it.

src/com/android/settings/TextToSpeechSettings.java

index 838d978..1a97fbf 100644 (file)
@@ -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);
+        }
     }
 
     /**