Email: check for closed cursor in onPostExecute for AsyncTasks.

BUG 2081965
This commit is contained in:
Mihai Preda 2009-08-28 02:05:31 +02:00
parent 52129ec4b2
commit 285efb4aff
4 changed files with 18 additions and 0 deletions

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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

View File

@ -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 {