title: Check if String in String[] is in ArrayList<string>
body: <p>I just built a Broadcast Receiver with which I can get the incoming text messages, than I split the text message when there's a space and save it into a <code>String[]</code>.</p>
  
  <p>Now I need to check if in this <code>String[]</code> is something from my database. For that I created a <code>ArrayList&lt;String&gt;</code>, which gets all the entries from the corresponding column. Now I need to check if a String in my <code>ArrayList</code> is the same in my <code>String[]</code> from the text message, but I don't know how to realize that.</p>
  
  <p>Is there an easy and fast way to check that, also I need to know which String is in both of them? </p>
  
  <p><strong>SmileySmsReceiver:</strong></p>
  
  <pre><code>  package de.retowaelchli.filterit.services;
  
  
      import java.util.ArrayList;
  
      import de.retowaelchli.filterit.database.SFilterDBAdapter;
      import android.content.BroadcastReceiver;
      import android.content.Context;
      import android.content.Intent;
      import android.database.Cursor;
      import android.os.Bundle;
      import android.telephony.SmsMessage;
      import android.util.Log;
      import android.widget.Toast;
  
  
  
      public class SmileySmsReceiver extends BroadcastReceiver {
  
          @Override
          public void onReceive(Context context, Intent intent) 
          {
              //Datenbank definieren
              SFilterDBAdapter mDbHelper = new SFilterDBAdapter(context);
  
  
              //---get the SMS message passed in---
              Log.d("SmileySmsReceiver", "Yes it calls the onReceive");
              Bundle bundle = intent.getExtras();        
              SmsMessage[] msgs = null;
              String str = "";            
              if (bundle != null)
              {
                  Log.d("SmileySmsReceiver", "Bundle is not null");
                  //---retrieve the SMS message received---
                  Object[] pdus = (Object[]) bundle.get("pdus");
                  msgs = new SmsMessage[pdus.length];            
                  for (int i=0; i&lt;msgs.length; i++){
                      msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                
                      str += "SMS from " + msgs[i].getOriginatingAddress();                     
                      str += " :";
                      str += msgs[i].getMessageBody().toString();
                      str += "\n";        
                  Log.d("SmileySmsReceiver","Was steht in der Nachricht?: " + str);
  
                  String[] splited = str.split("\\s+");
  
                  //Hier werden die Strings der Smileys aus der Datenbank gezogen
                  mDbHelper.open();
                  Cursor c = mDbHelper.getAllSFilter();
  
                  ArrayList&lt;String&gt; SmileyList = new ArrayList&lt;String&gt;();
                  c.getColumnIndex(SFilterDBAdapter.KEYWORD);
                  int ColumnIndex = c.getColumnIndex(SFilterDBAdapter.KEYWORD);
                      if(c!=null)
                          {
                          //Hier werden die Smileys in die ArrayList geschrieben
                          while(c.moveToNext()){
                              String infoItem = c.getString( ColumnIndex );
                              SmileyList.add(infoItem);
                          }
  &lt;------------------------- FROM HERE ON I NEED YOUR GUYS HELP -------------------------------&gt;
                  }
                  }
                  //---display the new SMS message---
                  Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
              }                         
          }
      }
  </code></pre>