Email: check for closed cursor in onPostExecute for AsyncTasks.
BUG 2081965
This commit is contained in:
parent
52129ec4b2
commit
285efb4aff
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user