views:

46

answers:

1

I have a ListView that is backed by a CursorAdapter. The cursor passed into the adapter is a MergeCursor. It is a MergeCursor because I have two tables, type1 and type2. I want to list all of the elements from type1 and type2 in a single ListView with all of the elements from type1 first, and all of the elements from type2 last. In addition, I want a different icon depending on which table the element came from. I am accomplishing this by checking a "type" field, located in the MergeCursor, when overriding newView(). Unfortunately, as I add rows to either type1 or type2, the ordering gets messed up. In other words, I have elements of type1 and type2 intermingled. Is there something I can do to prevent this reordering?

A: 

For anyone who may run into the same problem, I decided to create two ListViews instead of one. I set the weight to '1' and layout_height to 'fill_parent' in order to make them share equal space.

Matt Langston