0

我创建了一个服务来处理语音识别。我创建了一个单独的线程 ( ) 来在运行他的回调HandlerThread时处理消息。SpeechRecognitionioListener我注意到在onResult()收听停止后尝试调用startListener我的Handler但应用程序崩溃,当我startListenerActivity绑定到调用时Service,一切正常,但我想startListener从服务远程调用。是否有可能startListener()不从 UI 线程调用?

4

1 回答 1

0

我相信您不能在服务中运行语音识别,它必须在主(UI)线程中运行。如果您检查错误日志,您应该能够确认这确实是阻碍。

于 2013-09-05T23:19:58.873 回答