title: How would I use a different row layout in custom CursorAdapter based on Cursor data?
body: <p><strong>Background:</strong> I'm trying to implement a messenging system in my app, and I'm writing a custom <code>CursorAdapter</code> to display the messages in a <code>ListView</code> in the chat window.  I want to use a different row layout for incoming and outgoing messages (information that is saved in the SQLite row in the cursor).  Each row has the same elements in it with the same IDs, but they are arranged differently.</p>
  
  <p><strong>The Problem:</strong> Currently, I have overridden <code>newView()</code> and <code>bindView()</code>.  When the <code>ListView</code> is first populated, it creates all of the <code>View</code>s perfectly, checking each row to see if it's either incoming or outgoing, and inflating the proper XML file.  However, when I scroll or a new message is added to the window, the adapter recycles <code>View</code>s for the wrong rows.  I would override <code>getView()</code>, but it is not passed the <code>Cursor</code> as a parameter, so I have no way of knowing whether the row should be incoming or outgoing.</p>
  
  <p>I'm not looking for code, but rather, some suggestion for an elegant implementation.  Thanks in advance!</p>