Android listview with header layout
<p>I am rephrasing my question. Please bear with me. </p>

<p>I have a <code>Cursor</code>, which has <code>carNum</code> and tasks needs to be done on that. So <code>carNum</code> repeats in table. Right now I am using <code>SimpleCursorAdapter</code> and displaying all the info as a <code>listitem</code>. What I would like to do is set <code>carNum</code> as a header of a list and tasks need to be done as <code>listitems</code>. In addition to this, I would like to make header it's own layout so that I can display <code>carNum</code> and some info about it. So now where should I start ? </p>

<p>How should I get distinct <code>carNum</code> from <code>Cursor</code> and make that as header ? And then get <code>listitem</code> for that ? </p>

<p>Here is the .java</p>

<pre><code>public class MyTask extends Activity{

 String empid;
 ListView list;
 Cursor cursor = null; 
 TextView text;
 private  DbAdapter_Assignment assignment;

@Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.listlayout); 
         empid = getIntent().getExtras().getString("EmpID");
         getData(empid);
}

   public void getData(final String empid)
   {
        assignment =  new DbAdapter_Assignment(getBaseContext());
       assignment.open();

    cursor = assignment.getAcceptedTasks(empid);
    startManagingCursor(cursor);

    text = (TextView) findViewById(R.id.employeename);
    text.setText(getEmployeeName(empid) + " has "+ Integer.toString  (cursor.getCount()) + " tasks assigned." );
    list = (ListView) findViewById(R.id.mytasklist); 
    list.setOnItemClickListener(new OnItemClickListener() { 
        public void onItemClick(AdapterView&lt;?&gt; adapterView, View v, int arg2,
                long arg3) {         
        } 
   }); 

    SimpleCursorAdapter adapter = new SimpleCursorAdapter (this, R.layout.mytaskslayout, cursor, new String[] {"A","B", "C", "D", "E", "F"}, new int[] {R.id.a, R.id.b, R.id.c, R.id.d, R.id.e, R.id.f});
    list.setAdapter(adapter);
</code></pre>
