sim*_*dam 7 android exception text-to-speech
请问有人知道什么可能导致此异常吗? http://cl.ly/370E3C4425162j2F2b3h(来自LogCat的截图)
这就是我调用 TextToSpeech 的方式
public void say(String text, Context context, String utteranceID){
if(mTts == null){
this.text = text;
mTts = new TextToSpeech(context, (OnInitListener) helper);
}
else{
map.clear();
map.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, utteranceID);
mTts.speak(text, TextToSpeech.QUEUE_FLUSH, map);
}
}
Run Code Online (Sandbox Code Playgroud)
TextToSpeech 实际上按其应有的方式工作(但正如您所见,根本没有:),但由于我的应用程序经常使用 TTS,所以我在自定义帮助程序类中保存 TTS 实例..有时我遇到了异常。它是偶然出现的,有时它只是工作,有时 UI 冻结一段时间然后抛出异常。(整个东西是盲人用户界面的一部分)
如何修复 android.os.DeadObjectException android X
实际上这是可能的解决方案..但是在查看堆栈跟踪之后我认为我的问题是不同的