Android: Instantiating Multiple Widgets From One Layout Declaration
<p>I am creating a custom widget to display a rotating list of items.  I have declared the layout in <code>newsview.xml</code>:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;    
&lt;RelativeLayout
            android:id="@+id/tblLink"
            style="@style/newsviewstyle"
            android:layout_alignParentBottom="true"&gt;

            &lt;ImageView
                android:id="@+id/newsviewimg"
                style="@style/newsviewimgstyle"
                android:layout_margin="5dp" /&gt;

            &lt;TextView 
                android:id="@+id/newsviewtitle"
                android:layout_toRightOf="@id/newsviewimg"
                android:layout_marginTop="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginBottom="5dp"
                android:layout_width="fill_parent"
                android:layout_height="50dp"
                android:textColor="#000000" /&gt;
            &lt;TextView 
                android:id="@+id/newsviewurl"
                android:layout_toRightOf="@id/newsviewimg"
                android:layout_below="@id/newsviewtitle"
                android:layout_marginTop="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginBottom="5dp"
                android:layout_width="fill_parent"
                android:layout_height="15dp"
                android:textColor="#000000" /&gt;
        &lt;/RelativeLayout&gt;
</code></pre>

<p>The idea is in my <code>main.xml</code>, I have a <code>ViewFlipper</code> that I would like to use animate the transitions between each item.  How could I instantiate "n" unique items declared above, so they can bee added to the <code>ViewFlipper</code>.  How would I be able to get access to the layout declared from a class outside the main activity (and also outside the package containing the main application, i.e. a view controller).</p>

<p>As a note,  collecting the list of items takes place in a controller outside the main activity of my application.  I would like to keep everything as much as possible in the controller for possible reuse later on.</p>
