title: Searching an arrayList generated by an audio recognition
body: <p>I am working on app that take the audio of the user and save them in an arrayList, then searching this array list to see if the desired word generated by the google audio API exists, so we can do actions. The action that I wanted is removed and replace it with a textview just to see if it is work properly, the audio recog is working properly, but I always got the textview text as stop. So what is the problem ?</p>
  
  <pre><code>package myfirstapp.myapps.me.voicerecognition;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.speech.RecognizerIntent;
  import android.support.v7.app.ActionBarActivity;
  import android.view.View;
  import android.widget.Button;
  import android.widget.ListView;
  import android.widget.ArrayAdapter;
  import android.widget.TextView;
  import java.util.ArrayList;
  
  public class MainActivity extends ActionBarActivity implements View.OnClickListener {
      ListView lv;
      Button recBtn;
      static final int check = 1111;
      TextView tv;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          lv = (ListView) findViewById(R.id.lv);
          recBtn = (Button) findViewById(R.id.recBtn);
          tv = (TextView) findViewById(R.id.textView);
          recBtn.setOnClickListener(MainActivity.this);
      }
  
      public void onClick(View v) {
          Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
          i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
          i.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak");
          startActivityForResult(i, check);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          if (requestCode == check &amp;&amp; resultCode == RESULT_OK) {
              ArrayList&lt;String&gt; results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
              lv.setAdapter(new ArrayAdapter&lt;String&gt;(MainActivity.this, android.R.layout.simple_list_item_1, results));
              String s = "start";
              for (String string : results) {
  //                if(string.matches("start"))
  //                    tv.setText("Ok");
  //                else
  //                    tv.setText("No start");
  //                }
                  if (string.startsWith(s))
                      tv.setText("Start");
                  else
                      tv.setText("Stop");
              }
              super.onActivityResult(requestCode, resultCode, data);
  
          }
      }
  
  }
  </code></pre>