0
我用意圖語音識別,這裏是代碼:的Android RecognizerIntent簡單的破壞
/**
* Fire an intent to start the voice recognition activity.
*/
private void startVoiceRecognitionActivity()
{
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Voice recognition Demo...");
startActivityForResult(intent, REQUEST_CODE);
}
,一切工作正常。例如,現在我想在5秒後停止語音識別。我無法想象如何殺死語音識別活動。
你可以使用處理程序? – Sam 2013-05-13 09:38:51
我以爲Handler只是在一段時間後纔開始行動。它是否可以通過意圖關閉活動發佈? – 2013-05-13 09:42:08
這裏提到的解決方案有什麼? http://stackoverflow.com/questions/7361987/how-to-stop-an-app-after-some-time – sandkasten 2013-05-13 09:52:06