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
|
@Override
|
||||||
protected void onPostExecute(Cursor[] cursors) {
|
protected void onPostExecute(Cursor[] cursors) {
|
||||||
|
if (cursors[1].isClosed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mListAdapter = AccountsAdapter.getInstance(cursors[0], cursors[1],
|
mListAdapter = AccountsAdapter.getInstance(cursors[0], cursors[1],
|
||||||
AccountFolderList.this);
|
AccountFolderList.this);
|
||||||
mListView.setAdapter(mListAdapter);
|
mListView.setAdapter(mListAdapter);
|
||||||
|
@ -326,6 +326,9 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Cursor cursor) {
|
protected void onPostExecute(Cursor cursor) {
|
||||||
|
if (cursor.isClosed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
MailboxList.this.mListAdapter.changeCursor(cursor);
|
MailboxList.this.mListAdapter.changeCursor(cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -941,6 +941,9 @@ public class MessageList extends ListActivity implements OnItemClickListener, On
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Cursor cursor) {
|
protected void onPostExecute(Cursor cursor) {
|
||||||
|
if (cursor.isClosed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
MessageList.this.mListAdapter.changeCursor(cursor);
|
MessageList.this.mListAdapter.changeCursor(cursor);
|
||||||
|
|
||||||
// TODO: remove this hack and only update at the right time
|
// TODO: remove this hack and only update at the right time
|
||||||
|
@ -906,6 +906,9 @@ public class MessageView extends Activity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Cursor cursor) {
|
protected void onPostExecute(Cursor cursor) {
|
||||||
|
if (cursor.isClosed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// position the cursor on the current message
|
// position the cursor on the current message
|
||||||
while (cursor.moveToNext() && cursor.getLong(0) != mMessageId);
|
while (cursor.moveToNext() && cursor.getLong(0) != mMessageId);
|
||||||
mPrevNextCursor = cursor;
|
mPrevNextCursor = cursor;
|
||||||
@ -946,6 +949,9 @@ public class MessageView extends Activity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Cursor cursor) {
|
protected void onPostExecute(Cursor cursor) {
|
||||||
|
if (cursor.isClosed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (cursor.moveToFirst()) {
|
if (cursor.moveToFirst()) {
|
||||||
reloadUiFromCursor(cursor, mOkToFetch);
|
reloadUiFromCursor(cursor, mOkToFetch);
|
||||||
} else {
|
} else {
|
||||||
@ -984,6 +990,9 @@ public class MessageView extends Activity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Cursor cursor) {
|
protected void onPostExecute(Cursor cursor) {
|
||||||
|
if (cursor.isClosed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (cursor.moveToFirst()) {
|
if (cursor.moveToFirst()) {
|
||||||
reloadBodyFromCursor(cursor);
|
reloadBodyFromCursor(cursor);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user