Added a default fallback message for cases where the TTS plugin does
not provide a sample string.
This commit is contained in:
@@ -350,18 +350,11 @@ public class TextToSpeechSettings extends PreferenceActivity implements
|
|||||||
updateWidgetState();
|
updateWidgetState();
|
||||||
} else if (requestCode == GET_SAMPLE_TEXT) {
|
} else if (requestCode == GET_SAMPLE_TEXT) {
|
||||||
if (resultCode == TextToSpeech.LANG_AVAILABLE) {
|
if (resultCode == TextToSpeech.LANG_AVAILABLE) {
|
||||||
if (data == null){
|
String sample = getString(R.string.tts_demo);
|
||||||
// The GET_SAMPLE_TEXT activity for the plugin did not run properly;
|
if ((data != null) && (data.getStringExtra("sampleText") != null)) {
|
||||||
// return without doing anything.
|
sample = data.getStringExtra("sampleText");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (mTts != null) {
|
if (mTts != null) {
|
||||||
String sample = data.getStringExtra("sampleText");
|
|
||||||
if (sample == null){
|
|
||||||
// The GET_SAMPLE_TEXT activity for the plugin did not run properly;
|
|
||||||
// return without doing anything.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mTts.speak(sample, TextToSpeech.QUEUE_FLUSH, null);
|
mTts.speak(sample, TextToSpeech.QUEUE_FLUSH, null);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user