【发布时间】:2019-03-23 02:07:04
【问题描述】:
如何在 android firetv 中隐藏语音搜索图标扩展了 android.support.v17.leanback.app.SearchFragment 库。当我扩展该搜索库时,它在我的代码中将成为默认值...现在我不想使用语音搜索功能...
下面的监听器是默认的 :::
setSpeechRecognitionCallback(new SpeechRecognitionCallback() {
@Override
public void recognizeSpeech() {
Log.v(TAG, "recognizeSpeech");
try {
Intent mSpeechRecognizerIntent = getRecognizerIntent();
mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, new Long(3000));
mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, new Long(2000));
startActivityForResult(mSpeechRecognizerIntent, REQUEST_SPEECH);
//startActivityForResult(getRecognizerIntent(), REQUEST_SPEECH);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "Cannot find activity for speech recognizer", e);
}
}
});
【问题讨论】: