I have a speech recognition program that displays 5-6 results. I only want the 1st result to appear. Can you help with this please?
code:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if (requestCode == check && resultCode == RESULT_OK){
ArrayList<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, results));
}
Please advise?
Thank you.
FlinxSYS
There is a flag called
RecognizerIntent.EXTRA_MAX_RESULTS. You have to do this before thestartActivityForResult-call I guess (from the voice recognition example):