From c7a1f91230e2dad21a7c227819910e8d4e83fd02 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Tue, 14 Feb 2012 01:37:10 -0800 Subject: [PATCH] No more managed cursors. They are causing trouble in ICS. Lots of trouble. --- astrid/src/com/todoroo/astrid/activity/TaskListFragment.java | 3 --- astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java | 1 - astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java | 2 -- 3 files changed, 6 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java index c85530898..3a8c91d39 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java @@ -981,7 +981,6 @@ public class TaskListFragment extends ListFragment implements OnScrollListener, taskAdapter.flushCaches(); taskAdapter.notifyDataSetChanged(); } - getActivity().startManagingCursor(taskCursor); if (oldListItemSelected != ListView.INVALID_POSITION && oldListItemSelected < taskCursor.getCount()) @@ -1011,7 +1010,6 @@ public class TaskListFragment extends ListFragment implements OnScrollListener, // perform query TodorooCursor currentCursor = taskService.fetchFiltered( sqlQueryTemplate.get(), null, TaskAdapter.PROPERTIES); - getActivity().startManagingCursor(currentCursor); // set up list adapters taskAdapter = new TaskAdapter(this, R.layout.task_adapter_row, @@ -1059,7 +1057,6 @@ public class TaskListFragment extends ListFragment implements OnScrollListener, currentCursor = taskService.fetchFiltered(sqlQueryTemplate.get(), null, TaskAdapter.PROPERTIES); getListView().setFilterText(""); - getActivity().startManagingCursor(currentCursor); taskAdapter.changeCursor(currentCursor); diff --git a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java index 72c3d262f..753c43b7d 100644 --- a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java @@ -243,7 +243,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable { // perform query TodorooCursor newCursor = taskService.fetchFiltered( query.get(), constraint, TaskAdapter.PROPERTIES); - fragment.getActivity().startManagingCursor(newCursor); return newCursor; } diff --git a/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java b/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java index a7b48ba77..3fa9a4ee2 100644 --- a/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java +++ b/astrid/src/com/todoroo/astrid/ui/ContactListAdapter.java @@ -146,7 +146,6 @@ public class ContactListAdapter extends CursorAdapter { String sort = Email.TIMES_CONTACTED + " DESC LIMIT 20"; Cursor peopleCursor = mContent.query(uri, PEOPLE_PROJECTION, null, null, sort); - activity.startManagingCursor(peopleCursor); if(!completeSharedTags) return peopleCursor; @@ -159,7 +158,6 @@ public class ContactListAdapter extends CursorAdapter { Cursor tagCursor = tagDataService.query(Query.select(TagData.ID, TagData.NAME, TagData.PICTURE, TagData.THUMB). where(Criterion.and(TagData.USER_ID.eq(0), TagData.MEMBER_COUNT.gt(0), crit)).orderBy(Order.desc(TagData.NAME))); - activity.startManagingCursor(tagCursor); return new MergeCursor(new Cursor[] { tagCursor, peopleCursor }); }