Fix crash when resuming MessageListXL.

It's related to the use of Activity.manageQuery().
This may be a regression in the framework, but it's annoying enough and
causing a problem with testing, let's just not use managedQuery().

Bug 2901309.

Change-Id: I8ae5b6ffe17979a094d5a23d49f42e8de04ed4f0
This commit is contained in:
Makoto Onuki 2010-08-09 15:25:01 -07:00
parent 2cb5b04204
commit f48fe98b2a

View File

@ -894,7 +894,8 @@ public class MessageListFragment extends ListFragment implements OnItemClickList
// Load messages // Load messages
String selection = String selection =
Utility.buildMailboxIdSelection(mResolver, mMailboxKey); Utility.buildMailboxIdSelection(mResolver, mMailboxKey);
Cursor c = mActivity.managedQuery(EmailContent.Message.CONTENT_URI, MESSAGE_PROJECTION, Cursor c = mActivity.getContentResolver().query(
EmailContent.Message.CONTENT_URI, MESSAGE_PROJECTION,
selection, null, EmailContent.MessageColumns.TIMESTAMP + " DESC"); selection, null, EmailContent.MessageColumns.TIMESTAMP + " DESC");
return c; return c;
} }
@ -910,7 +911,6 @@ public class MessageListFragment extends ListFragment implements OnItemClickList
} }
MessageListFragment.this.mAccountId = mAccountKey; MessageListFragment.this.mAccountId = mAccountKey;
// TODO changeCursor(null)??
mListAdapter.changeCursor(cursor); mListAdapter.changeCursor(cursor);
setListAdapter(mListAdapter); setListAdapter(mListAdapter);