how to take the first element of a list of lists and display in a text view

advertisements
ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
wordsList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
                matches));

I want to change this code. I want to take the first element of the wordList and show in a text view


try this not sure it perfect or not but try it

String text = ((TextView)(wordsList.getItemAtPosition(0))).getText();
yourTextView.setText(text);

or you can get the direct value from the ArrayList

String text = matches.get(0).toString();
yourTextView.setText(text);