swapCursor for SimpleCursorTreeAdapter

334 views
Skip to first unread message

jonas gehring

unread,
Jul 13, 2011, 5:41:08 AM7/13/11
to android-...@googlegroups.com
Hello.
For honeycomb I'm refectoring my app to use the new Loader classes introduced here:


This example uses a simple ListView with SimpleCursorAdapter. But my app uses a ExpandableListView with SimpleCursorTreeAdapter.

Now the problem is, that I need to call the swapCursor method on the adapter but the SimpleCursorTreeAdapter does not implement this method.
So the example does not work for ExpandableListView:
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
   
// Swap the new cursor in.  (The framework will take care of closing the
   
// old cursor once we return.)
    mAdapter
.swapCursor(data);
}

There is only the method "changeCursor" but this closes the cursor but is wrong!

If there were source code for CursorAdapter#swapCursor available, I could patch it on my own, but I checked out the source code and there is no tag android-3xxx for frameworks/base package.

Can anybody help me?

Etienne Lawlor

unread,
May 13, 2012, 1:00:59 PM5/13/12
to android-...@googlegroups.com
I am running into the same exact issue.  I was wondering if you have come up with a solution.

Etienne Lawlor

unread,
May 13, 2012, 1:01:53 PM5/13/12
to android-...@googlegroups.com
I am running into the same exact issue.  I was wondering if someone has come up with a solution.


On Wednesday, July 13, 2011 2:41:08 AM UTC-7, Jonas Gehring wrote:
Reply all
Reply to author
Forward
0 new messages