如何在 Listview wordList 上设置 onclickListener 以检索列表中显示的文本?另外我应该在哪里写那个函数?我是一个天真的 Android 开发人员,找不到合适的例子!
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK)
{
// Populate the wordsList with the String values the recognition engine thought it heard
matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
wordsList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,matches));
}
super.onActivityResult(requestCode, resultCode, data);
}