title: Null pointer reference on TextView inside Adapter
body: <p>I made my own custom adapter to support multiple types of <code>ListView</code> Items but I keep getting null pointer exceptions. Is there something with the <code>convertView</code> that I am not using? Anyone have any insight?</p>
  
  <p>Here is my <strong>adapter</strong> class:</p>
  
  <pre><code>package com.lucasmikesoftware.messaround;
  
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import com.squareup.picasso.Picasso;
  
  import java.util.ArrayList;
  
  
  public class MyAdapter extends ArrayAdapter&lt;AdapterData&gt; {
  private int layoutId;
  public MyAdapter(Context context, ArrayList&lt;AdapterData&gt; data, int layoutId) {
      super(context, R.layout.events_list_item, data);
      this.layoutId = layoutId;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      if(getItem(position) instanceof ImageAdapterData){
          return setImageListItem(position,parent);
      } else if (getItem(position) instanceof VideoAdapterData){
          return setVideoListItem(position,parent);
      } else if (getItem(position) instanceof EventAdapterData){
          return setEventListItem(position,parent);
      } else{
          return setNormalListItem(position,parent);
      }
  
  
  }
  
  public View setNormalListItem(int position,ViewGroup parent){
      LayoutInflater theInflater = LayoutInflater.from(getContext());
      View theView = theInflater.inflate(layoutId,parent,false);
      AdapterData adapterData = getItem(position);
      TextView theTextView = (TextView) theView.findViewById(R.id.normal_list_item_title);
      theTextView.setText(adapterData.getTitle());
      TextView theFullTextTextView = (TextView) theView.findViewById(R.id.normal_list_item_full_text);
      theFullTextTextView.setText(adapterData.getFullText());
      return theView;
  }
  
  public View setImageListItem(int position,ViewGroup parent){
      LayoutInflater theInflater = LayoutInflater.from(getContext());
      View theView = theInflater.inflate(layoutId,parent,false);
      ImageAdapterData adapterData = (ImageAdapterData) getItem(position);
      TextView theTextView = (TextView) theView.findViewById(R.id.image_list_item_title);
      theTextView.setText(adapterData.getTitle());
      TextView theFullTextTextView = (TextView) theView.findViewById(R.id.image_list_item_full_text);
      theFullTextTextView.setText(adapterData.getFullText());
      ImageView theImageView = (ImageView) theView.findViewById(R.id.image_list_item_image);
      Picasso.with(getContext()).load(adapterData.getImageUrl()).into(theImageView);
      return theView;
  }
  
  public View setEventListItem(int position,ViewGroup parent){
      LayoutInflater theInflater = LayoutInflater.from(getContext());
      View theView = theInflater.inflate(layoutId,parent,false);
      EventAdapterData adapterData = (EventAdapterData) getItem(position);
      TextView theTextView = (TextView) theView.findViewById(R.id.text_view);
      theTextView.setText(adapterData.getTitle());
      ImageView theImageView = (ImageView) theView.findViewById(R.id.event_image_view);
      Picasso.with(getContext()).load(adapterData.getImageUrl()).into(theImageView);
      return theView;
  }
  
  public View setVideoListItem(int position,ViewGroup parent){
      //TODO Finish this damn thing
      return parent;
  }
  
  }
  </code></pre>
  
  <p>Here are the <strong>error logs</strong>:</p>
  
  <pre><code> 07-30 23:55:24.928 16830-16830/com.lucasmikesoftware.messaround E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.lucasmikesoftware.messaround, PID: 16830
  java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
  at com.lucasmikesoftware.fuckaround.MyAdapter.setImageListItem(MyAdapter.java:69)
  at com.lucasmikesoftware.fuckaround.MyAdapter.getView(MyAdapter.java:42)
  at android.widget.AbsListView.obtainView(AbsListView.java:2467)
  at android.widget.ListView.measureHeightOfChildren(ListView.java:1270)
  at android.widget.ListView.onMeasure(ListView.java:1182)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5478)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
  at android.view.View.measure(View.java:17536)
  at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1626)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5478)
  at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
  at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
  at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
  at android.view.View.measure(View.java:17536)
  at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727)
  at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5478)
  at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:671)
  at android.support.design.widget.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:90)
  at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1319)
  at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:736)
  at android.view.View.measure(View.java:17536)
  at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1079)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5478)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
  at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5478)
  at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
  at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
  at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5478)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5478)
  at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
  at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
  at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5478)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
  at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2629)
  at android.view.View.measure(View.java:17536)
  at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2102)
  at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1218)
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1435)
  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1106)
  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6018)
  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:792)
  at android.view.Choreographer.doCallbacks(Choreographer.java:596)
  at android.view.Choreographer.doFrame(Choreographer.java:557
  </code></pre>