how to create attribute name on each of the column of a listview?
<p>I have populated a listview(4columns) using simpleadapter and hashmap. Now I would like to have each column of the listview a name.</p>

<p>My listview is displayed inside a linear layout with 4 textviews.</p>

<p>Now, in order to have attribute name of each column, I try to have 2 linear layouts, and the top linear layout have 4 textviews with the attribute names, the bottom linear layout with the data from simpleadapter. And put two linear layouts inside a another linear layout.</p>

<p>And this didn't work the way i want...
I am fairly new to android, please help.</p>

<p>Edit:</p>

<p>Here is my code:</p>

<p>public class MultiList extends ListActivity {</p>

<pre><code>ListView lv;
SimpleAdapter sd;


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Calendar c = Calendar.getInstance();
    lv = getListView();
    ArrayList&lt;HashMap&lt;String, String&gt;&gt; aList = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();
    HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
    map.put("Date", ""+c.get(Calendar.DATE));
    map.put("Month", ""+c.get(Calendar.MONTH)+1);
    map.put("Time", "" + new Date().toString());
    aList.add(map);
    map = new HashMap&lt;String, String&gt;();
    map.put("Date", ""+c.get(Calendar.DATE));
    map.put("Month", ""+c.get(Calendar.MONTH)+1);
    map.put("Time", "" + new Date().toString());
    aList.add(map);
    map = new HashMap&lt;String, String&gt;();
    map.put("Date", ""+c.get(Calendar.DATE));
    map.put("Month", ""+c.get(Calendar.MONTH)+1);
    map.put("Time", "" + new Date().toString());
    aList.add(map);
    sd= new SimpleAdapter(this, aList, R.layout.main, new String[]{"Date","Month","Time"}, new int[]{R.id.studentID,R.id.studentAge,R.id.studentName});
    lv.setAdapter(sd);



   // insertData();


}
</code></pre>

<p>My main.xml</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" &gt;

    &lt;LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/linear1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        android:paddingBottom="6dip"
        android:paddingTop="4dip" &gt;

        &lt;TextView
            android:layout_width="90dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="student ID" /&gt;

        &lt;TextView
            android:layout_width="90dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="student Age" /&gt;

        &lt;TextView
            android:layout_width="90dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="student Name" /&gt;
    &lt;/LinearLayout&gt;

    &lt;LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/linear1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        android:paddingBottom="6dip"
        android:paddingTop="4dip" &gt;

        &lt;TextView
            android:id="@+id/studentID"
            android:layout_width="90dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
             /&gt;

        &lt;TextView
            android:id="@+id/studentAge"
            android:layout_width="90dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
           /&gt;

        &lt;TextView
            android:id="@+id/studentName"
            android:layout_width="90dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
             /&gt;
    &lt;/LinearLayout&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>The problem is, each of the attribute name (student ID, student Age, Student Name) is repeated on every row. How do I fix that?</p>
