title: How do I use my new custom view in my ListView?
body: <p>I'm new to Android so please forgive my ignorance~ I have a few questions that I haven't been able to find the answers to.</p>
  
  <p>I've created a new view called <code>ImageTapView</code>. The idea is that when you tap the view, an info overlay would appear. Here's the class (just barebones right now):</p>
  
  <pre><code>package com.mysite;
  
  public class ImageTapView extends View {
      public ImageTapView(Context context, AttributeSet attrs){
          super(context, attrs);
          init(context);
      }
      private void init(Context context){
  
      }
      public void onClick(){
  
      }    
  }
  </code></pre>
  
  <p>So far I've:</p>
  
  <ol>
  <li><p>Created the custom class file</p></li>
  <li><p>Create a layout xml file called <code>image_tap_view.xml</code> (I think I might be wrong here)</p></li>
  <li><p>Added <code>declare-stylable</code> to my <strong>res/values/attrs.xml</strong></p></li>
  </ol>
  
  <p>And I'm pretty confused. Right now in my <code>ListAdapter</code> I'm returning an <code>ImageView</code> in <code>getView()</code>. So now I'd like to return an <code>ImageTapView</code> instead but pass the <code>ImageView</code> into my <code>ImageTapView</code>. So my question is: <strong>How do I pass this <code>ImageView</code> to the <code>ImageTapView</code></strong>?</p>
  
  <p>Secondly, I'm pretty confused about the layout files. Right now in my <code>image_tap_view.xml</code> I have this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:custom="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;com.mysite.ImageTapView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="#333333"
          custom:labelPosition="left"
          custom:showText="true"
          /&gt;
      &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Custom view Test"
              /&gt;
  
          &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>But it seems wrong to have my own custom view inside of my custom view layout xml. Wouldn't that cause an infinite loop? So my question is: <strong>Where and how do I specify the layout for my new <code>ImageTapView</code></strong>?</p>
  
  <p>Thanks in advance!</p>