title: getStringArrayListExtra returns nullpointerexception for size()
body: <p>I am trying to use <code>getStringArrayListExtra()</code> to get an arrayList of strings passed through an intent. Basically, I get the strings from a listView inside an activity, pass them into an activity, and then pass it into a Service to do what I need it to do. The problem arises when I try to call <code>.size()</code>. It throws a nullpointerexception. </p>
  
  <p>Here's the code I've used so far:</p>
  
  <p>FirstActivity:</p>
  
  <pre><code>public void chatStart(View v){
  
      //Clears all duplicates
      Set setItems = new LinkedHashSet(selectedFriend);
      selectedFriend.clear();
      selectedFriend.addAll(setItems);
  
      Intent intent = new Intent(this, TestScreen.class);
      intent.putStringArrayListExtra("Friend_List", selectedFriend);
      startActivity(intent);
  
  }
  </code></pre>
  
  <p>SecondActivity</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      Intent intent = getIntent();
  
      setContentView(R.layout.testscreen);
  
      EditText et = (EditText)findViewById(R.id.friendsList);
      ArrayList&lt;String&gt; itemlist = intent.getStringArrayListExtra("Friend_List");
  
      for(int i = 0; i&lt;itemlist.size(); i++){
  
          if(itemlist.get(i) == null){
              Toast.makeText(this,"Something Went Wrong",Toast.LENGTH_SHORT).show();
  
          }else{
  
              et.append(itemlist.get(i) + " ");
  
          }
  
      }
  
  }
  
  public void createStream(View view){
  
      Intent intent = getIntent();
  
      EditText et = (EditText)findViewById(R.id.friendsList);
      EditText et2 = (EditText)findViewById(R.id.message);
  
      ArrayList&lt;String&gt; itemlist2 = intent.getStringArrayListExtra("Friend_List");
  
      if(et2.getText().toString() != null &amp;&amp; et.getText().toString() != null){
          Intent intent2 = new Intent(this, StreamBuilder.class);
  
          intent.putStringArrayListExtra("Friend_List",itemlist2);
          intent.putExtra("Stream_Title",et.getText().toString());
          intent.putExtra("Message",et2.getText().toString());
  
          startService(intent2);
  
      }else{
          Toast.makeText(this, "Please Fill In All Fields", Toast.LENGTH_LONG).show();
  
      }
  
  
  
  }
  </code></pre>
  
  <p>Service</p>
  
  <pre><code>@Override
  public int onStartCommand(Intent intent, final int flags, final int startId) {
  
      ArrayList&lt;String&gt; users = intent.getStringArrayListExtra("Friend_List");
  
      String title = intent.getStringExtra("Stream_Title");
  
  
      for (int i = 0; i &lt; users.size(); i++) { //Where the nullpointerexception error occurs
  
          //Do This
  
      }
  
      stopSelf()
  
      return super.onStartCommand(intent, flags, startId);
  
  }
  </code></pre>
  
  <p>All Help is appreciated.</p>