Create "Sub-Views" in Android (Newbie-Question)
<p><br>
sorry for the poor choice of words, I dont know exactly how the Android terminology is, therefore google wasn't much help either.</p>

<p>What I need to do seems simple: I have a table as part of my "main view" which is created when the activity launches. No problem here, I can get the table in code and e.g. add rows.</p>

<p>What I would like to do is "prepare" the row in a different XML file, basically creating the layout using XML and then creating an instance of that TableRow in code, adding it to my main table.</p>

<p>I know the alternative approach (to create the whole row in code), but this would be more cumbersome then using XML for most of the attributes, and only fill the ones I need later by code (label and image).</p>

<p>[UPDATE]</p>

<p>Ok, I managed to solve half of my problem using the ListActivity. There is one little problem remaining, I don't know how to tell Android to use more then one string.</p>

<p>The code looks like this:</p>

<pre><code>public class ListScreenAlle extends ListActivity {

String[] listItems = {"exploring", "android", "list", "activities"};

@Override
protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);

    // We'll define a custom screen layout here (the one shown above), but
    // typically, you could just use the standard ListActivity layout.
    setContentView(R.layout.list_screen_layout_alle);

    //setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, listItems));
    setListAdapter(new ArrayAdapter(this, R.layout.list_row_single, listItems));
}
</code></pre>

<p>}</p>

<p>And the XML used for the row looks like this:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;TextView android:id="@+id/text1"  xmlns:android="http://schemas.android.com/apk/res/android"
     android:textSize="16sp"
     android:textStyle="bold"
     android:layout_width="match_parent"
     android:layout_height="wrap_content" android:textColor="@color/text_color_list_label"/&gt;
</code></pre>

<p>How do I change this code to support a more complex object than a single string. Eg a person with a thumbnail and firstname, lastname.</p>

<p>The ArrayAdapter in its simple form only allows a single textfield, how would I explain to it that my row has 3 fields, an image, two strings, and that it should "BIND" the image to property Thumbnail, and the textfields to firstname and lastname?</p>
