use of android.support.v17.leanback.widget.SpeechRecognitionCallback in project vlc-android by videolan.
the class SearchFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
setSearchResultProvider(this);
setOnItemViewClickedListener(getDefaultItemClickedListener());
mDelayedLoad = new SearchRunnable();
mActivity = getActivity();
final Intent recognitionIntent = getRecognizerIntent();
if (Util.isCallable(recognitionIntent)) {
final SpeechRecognitionCallback speechRecognitionCallback = new SpeechRecognitionCallback() {
@Override
public void recognizeSpeech() {
startActivityForResult(recognitionIntent, REQUEST_SPEECH);
}
};
setSpeechRecognitionCallback(speechRecognitionCallback);
}
final Intent intent = mActivity.getIntent();
if (Intent.ACTION_SEARCH.equals(intent.getAction()) || "com.google.android.gms.actions.SEARCH_ACTION".equals(intent.getAction()))
onQueryTextSubmit(intent.getStringExtra(SearchManager.QUERY));
}
use of android.support.v17.leanback.widget.SpeechRecognitionCallback in project vlc-android by GeoffreyMetais.
the class SearchFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
setSearchResultProvider(this);
setOnItemViewClickedListener(getDefaultItemClickedListener());
mDelayedLoad = new SearchRunnable();
mActivity = getActivity();
final Intent recognitionIntent = getRecognizerIntent();
if (Util.isCallable(recognitionIntent)) {
final SpeechRecognitionCallback speechRecognitionCallback = new SpeechRecognitionCallback() {
@Override
public void recognizeSpeech() {
startActivityForResult(recognitionIntent, REQUEST_SPEECH);
}
};
setSpeechRecognitionCallback(speechRecognitionCallback);
}
final Intent intent = mActivity.getIntent();
if (Intent.ACTION_SEARCH.equals(intent.getAction()) || "com.google.android.gms.actions.SEARCH_ACTION".equals(intent.getAction()))
onQueryTextSubmit(intent.getStringExtra(SearchManager.QUERY));
}
Aggregations