title: ArrayList.contains("text") throws NullPointerException?
body: <p>I'm to trying to make an android app where I accept input from the user using the speech Recognition server. I'm capturing the results in a ArrayList as follows :</p>
  
  <pre><code>matches = data.getStringArrayListExtra(
                      RecognizerIntent.EXTRA_RESULTS);
  </code></pre>
  
  <p>matches is declared globally as :</p>
  
  <pre><code>ArrayList&lt;string&gt; matches;
  </code></pre>
  
  <p>Now I want to check if the user has spoken a particular word. So I do this :</p>
  
  <pre><code>if(matches.contains("TextToBeDetected")) { }
  </code></pre>
  
  <p>But the line above throws a NullPointerException.</p>
  
  <p>Please help.</p>
  
  <p>P.S Yes, I'm a Java and Android newbie.</p>