diff --git a/src/com/android/email/activity/AccountFolderList.java b/src/com/android/email/activity/AccountFolderList.java index 8eab3c98c..58050ddac 100644 --- a/src/com/android/email/activity/AccountFolderList.java +++ b/src/com/android/email/activity/AccountFolderList.java @@ -348,6 +348,9 @@ public class AccountFolderList extends ListActivity @Override protected void onPostExecute(Cursor[] cursors) { + if (cursors[1].isClosed()) { + return; + } mListAdapter = AccountsAdapter.getInstance(cursors[0], cursors[1], AccountFolderList.this); mListView.setAdapter(mListAdapter); diff --git a/src/com/android/email/activity/MailboxList.java b/src/com/android/email/activity/MailboxList.java index ac0ec3d49..2bcb3b638 100644 --- a/src/com/android/email/activity/MailboxList.java +++ b/src/com/android/email/activity/MailboxList.java @@ -326,6 +326,9 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On @Override protected void onPostExecute(Cursor cursor) { + if (cursor.isClosed()) { + return; + } MailboxList.this.mListAdapter.changeCursor(cursor); } } diff --git a/src/com/android/email/activity/MessageList.java b/src/com/android/email/activity/MessageList.java index ae140e6aa..02a5a0cbe 100644 --- a/src/com/android/email/activity/MessageList.java +++ b/src/com/android/email/activity/MessageList.java @@ -941,6 +941,9 @@ public class MessageList extends ListActivity implements OnItemClickListener, On @Override protected void onPostExecute(Cursor cursor) { + if (cursor.isClosed()) { + return; + } MessageList.this.mListAdapter.changeCursor(cursor); // TODO: remove this hack and only update at the right time diff --git a/src/com/android/email/activity/MessageView.java b/src/com/android/email/activity/MessageView.java index 5fdabf909..91d9e878b 100644 --- a/src/com/android/email/activity/MessageView.java +++ b/src/com/android/email/activity/MessageView.java @@ -906,6 +906,9 @@ public class MessageView extends Activity @Override protected void onPostExecute(Cursor cursor) { + if (cursor.isClosed()) { + return; + } // position the cursor on the current message while (cursor.moveToNext() && cursor.getLong(0) != mMessageId); mPrevNextCursor = cursor; @@ -946,6 +949,9 @@ public class MessageView extends Activity @Override protected void onPostExecute(Cursor cursor) { + if (cursor.isClosed()) { + return; + } if (cursor.moveToFirst()) { reloadUiFromCursor(cursor, mOkToFetch); } else { @@ -984,6 +990,9 @@ public class MessageView extends Activity @Override protected void onPostExecute(Cursor cursor) { + if (cursor.isClosed()) { + return; + } if (cursor.moveToFirst()) { reloadBodyFromCursor(cursor); } else {