title: SetAdapter for arrayadapter is crashing
body: <p>My app keeps crashing whenever my setadapter function gets called and I have no idea why, can anyone help? The emulator that I am running just says that the app has stopped unexpectedly.</p>
  
  <p>This is my Main</p>
  
  <pre><code>public class MainActivity extends Activity {
  
      private ListView listView1;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Ride ride_data[] = new Ride[]
          {
                  new Ride("LA Trip", "la man"),
                  new Ride("SD Trip", "sd man"),
                  new Ride("SF Trip", "sf man")
          };
  
          RideAdapter adapter = new RideAdapter(this,
                  R.layout.listview_item_row,ride_data);
  
          listView1 = (ListView)findViewById(R.id.listView1);
  
          View header = (View)getLayoutInflater().inflate(R.layout.listview_header_row, null);
          listView1.addHeaderView(header);
  
          listView1.setAdapter(adapter);
  
      }
  
  }
  </code></pre>
  
  <p>and this is my Adapter</p>
  
  <pre><code>public class RideAdapter extends ArrayAdapter&lt;Ride&gt;{
  
      Context context;
      int layoutResourceId;
      Ride data[] = null;
  
      public RideAdapter(Context context, int layoutResourceId, Ride[] data)
      {
          super(context,layoutResourceId,data);
          this.context = context;
          this.layoutResourceId = layoutResourceId;
          this.data = data;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent)
      {
          View row = convertView;
          RideHolder holder = null;
  
          if(row == null)
          {
              LayoutInflater inflater = ((Activity)context).getLayoutInflater();
              row = inflater.inflate(layoutResourceId, parent, false);
  
              holder = new RideHolder();
              holder.rideName = (TextView)row.findViewById(R.id.txtRideName);
              holder.personName = (TextView)row.findViewById(R.id.txtPersonName);
  
              row.setTag(holder);
          }
          else
          {
              holder = (RideHolder)row.getTag();
          }
  
          Ride ride = data[position];
          holder.rideName.setText(ride.rideName);
          holder.personName.setText(ride.personName);
  
          return row;
  
      }
  
      public static class RideHolder
      {
          TextView rideName;
          TextView personName;
      }
  }
  </code></pre>
  
  <p>this is my ride class</p>
  
  <pre><code>public class Ride {
      public String rideName;
      public String personName;
  
      public Ride()
      {
  
      }
  
      public Ride(String rideName, String personName)
      {
          super();
          this.rideName=rideName;
          this.personName=personName;
      }
  }
  </code></pre>
  
  <p>and finally this is my list item view</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"
      android:padding="10dp"
       &gt;
  
      &lt;Textview
          android:id="@+id/txtRideName"
          android:layout_width ="wrap_content"
          android:layout_height="fill_parent"
          android:gravity="center_horizontal"
          /&gt;
      &lt;Textview
          android:id="@+id/txtPersonName"
          android:layout_width ="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center_horizontal"
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>any help would be greatly appreciated!</p>