Computation on db data then list them using either SimpleCursorAdapter or ArrayAdapter
<p>I juststarted programming in android a few weeks ago, so I am not entirely sure how to deal with listing values. Please help me out!
I have some questions regarding displaying data sets from db in a list. Currently I have a cursor returned by my db points to a list of rows and I want display 2 columns values in a single row of the list. The row xml looks like this: </p>

<pre><code> &lt;TextView android:id="@+id/text1"
     android:textSize="16sp"
     android:textStyle="bold"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"/&gt;

 &lt;TextView android:id="@+id/text2"
     android:textSize="14sp"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"/&gt;
</code></pre>

<p>so I was thinking using simplecursoradapter which supposedly makes my life easier by displaying the data in a list. However that is only true if I want to display the raw data. 
For the purpose of my program I need to do some computations on the raw data sets, then display them. I am not sure how to do that using SimpleCursorAdapter. Here's how I display the raw data:</p>

<pre><code>   String[] from = new String[]{BtDbAdapter.KEY_EX_TYPE,BtDbAdapter.KEY_EX_TIMESTAMP};

   int[] to = new int[]{R.id.text1, R.id.text2};

    // Now create a simple cursor adapter and set it to display
    SimpleCursorAdapter records = 
            new SimpleCursorAdapter(this, R.layout.exset_row, mExsetCursor, from, to);

    setListAdapter(records);
</code></pre>

<p>Is there a way to do computation on the data in those rows before I bind it with the SimpleCursorAdapter? I was trying to use an alternative way of doing this by using arraylist and arrayadapter, but that way I dont know to how achieve displaying 2 items in a single row.</p>

<p>This is my code for using arrayadapter which only display 1 text in a row instead of 2 textviews in a row:</p>

<pre><code>  //fill in the array
  timestamp_arr = new ArrayList&lt;String&gt;();
  type_arr = new ArrayList&lt;String&gt;();
  fillRecord();

  Log.d(TAG,"setting now in recordlist");
  setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item,timestamp_arr));
  setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item2,type_arr));
</code></pre>

<p>It's very obvious that it only displays one textview in a row because I set the second arrayadapter overwrites the first one! I was trying to use R.id.text1 and R.id.text2 for them, but it gave me some errors saying 
04-23 01:40:58.658: ERROR/AndroidRuntime(3309): android.content.res.Resources$NotFoundException: Resource ID #0x7f070008 type #0x12 is not valid</p>

<p>I believe the second method can achieve this, but I'm not sure how do deal with the layout problems, so if you any suggestions, please post them out. Thank you!! </p>
