title: Add custom view (ad space) programmatically in ArrayAdapter
body: <p>I'm trying to add a custom view programmatically into a listview of images in the custom adapter. Currently I'm trying to add it as the third "image". Not that steady on my customer adapter, so not sure how to get it to work. Populating all the images works perfect, but cant get that ad space in between there. Any suggestions?</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
  
      View rowView = convertView;
      if (rowView == null) {
          LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          rowView = inflater.inflate(R.layout.image_row, null);
          ViewHolder viewHolder = new ViewHolder();
  
          if(position==3) {
              adSpace = new AdSpace(context, "c026dd7e-60a5-46c9-948f-38eb18a", true);
              adSpace.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT));
  
              Log.i("AdSpace","Adding adspace");
          } else {
              viewHolder.image = (ImageView) rowView.findViewById(R.id.offer_row);
          }
          rowView.setTag(viewHolder);
      }
  
  
  
      ViewHolder holder = (ViewHolder) rowView.getTag();
      imageLoader.displayImage(imageURLArray.get(position), holder.image, options);
  
      return rowView;
  
  }
  static class ViewHolder {
      public ImageView image;
      public AdSpace adspace;
  }
  </code></pre>
  
  <p>list.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;"packagename".ZoomView xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"&gt;
      &lt;ListView
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:id="@+id/offer_list" /&gt;    
  </code></pre>
  
  <p></p>
  
  <p>image_row.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res/"packagename""
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"&gt;  
  &lt;ImageView
      android:id="@+id/offer_row"
      android:layout_width="fill_parent"
      android:layout_height="match_parent"
      android:layout_gravity="center"
      android:adjustViewBounds="true"
      android:scaleType="fitXY"
      android:contentDescription="Image" /&gt;  
  </code></pre>
  
  <p></p>