Code example for ArrayList

Methods: get, size

0
            if (resultCode == Activity.RESULT_OK) {
                // Fill the quickAddBox-view with the string the recognizer thought it could have heard 
                ArrayList<String> match = data.getStringArrayListExtra(
                        RecognizerIntent.EXTRA_RESULTS);
                // make sure we only do this if there is SomeThing (tm) returned 
                if (match != null && match.size() > 0 && match.get(0).length() > 0) {
                    String recognizedSpeech = match.get(0);
                    recognizedSpeech = recognizedSpeech.substring(0, 1).toUpperCase() +
                        recognizedSpeech.substring(1).toLowerCase();
 
                    if(append)
                        textField.setText((textField.getText() + " " + recognizedSpeech).trim());
                    else 
                        textField.setText(recognizedSpeech);
                } 
            } 
        } 
 
        return result;
    }