am 4f11b50d
: MessageView: Bug 2097855, observer on prevNextCursor unregistered twice.
Merge commit '4f11b50de573ab8ce937e5c7544ec4c21bd62f1f' * commit '4f11b50de573ab8ce937e5c7544ec4c21bd62f1f': MessageView: Bug 2097855, observer on prevNextCursor unregistered twice.
This commit is contained in:
commit
4e313bfe66
@ -366,9 +366,9 @@ public class MessageView extends Activity implements OnClickListener {
|
|||||||
if (mMessage != null) {
|
if (mMessage != null) {
|
||||||
startPresenceCheck();
|
startPresenceCheck();
|
||||||
|
|
||||||
// get a new next/prev cursor, but only if we already had one
|
// get a new next/prev cursor, but only if mailbox is set
|
||||||
// (otherwise it's "too soon" and other pathways will cause it to be loaded)
|
// (otherwise it's "too soon" and other pathways will cause it to be loaded)
|
||||||
if (mLoadPrevNextTask == null && mPrevNextCursor != null) {
|
if (mLoadPrevNextTask == null && mMailboxId != -1) {
|
||||||
mLoadPrevNextTask = new LoadPrevNextTask(mMailboxId);
|
mLoadPrevNextTask = new LoadPrevNextTask(mMailboxId);
|
||||||
mLoadPrevNextTask.execute();
|
mLoadPrevNextTask.execute();
|
||||||
}
|
}
|
||||||
@ -379,10 +379,14 @@ public class MessageView extends Activity implements OnClickListener {
|
|||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
mController.removeResultCallback(mControllerCallback);
|
mController.removeResultCallback(mControllerCallback);
|
||||||
// Manage the next/prev cursor
|
closePrevNextCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closePrevNextCursor() {
|
||||||
if (mPrevNextCursor != null) {
|
if (mPrevNextCursor != null) {
|
||||||
mPrevNextCursor.unregisterContentObserver(mNextPrevObserver);
|
mPrevNextCursor.unregisterContentObserver(mNextPrevObserver);
|
||||||
mPrevNextCursor.deactivate();
|
mPrevNextCursor.close();
|
||||||
|
mPrevNextCursor = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,12 +420,7 @@ public class MessageView extends Activity implements OnClickListener {
|
|||||||
mMessageContentView.destroy();
|
mMessageContentView.destroy();
|
||||||
mMessageContentView = null;
|
mMessageContentView = null;
|
||||||
}
|
}
|
||||||
// Destroy the next/prev cursor if we're holding one
|
// the next/prev cursor was closed in onPause()
|
||||||
// Note, the observer was already unregistered in onPause()
|
|
||||||
if (mPrevNextCursor != null) {
|
|
||||||
mPrevNextCursor.close();
|
|
||||||
mPrevNextCursor = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDelete() {
|
private void onDelete() {
|
||||||
@ -970,10 +969,7 @@ public class MessageView extends Activity implements OnClickListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// replace the older cursor if there is one
|
// replace the older cursor if there is one
|
||||||
if (mPrevNextCursor != null) {
|
closePrevNextCursor();
|
||||||
mPrevNextCursor.unregisterContentObserver(MessageView.this.mNextPrevObserver);
|
|
||||||
mPrevNextCursor.close();
|
|
||||||
}
|
|
||||||
mPrevNextCursor = cursor;
|
mPrevNextCursor = cursor;
|
||||||
mPrevNextCursor.registerContentObserver(MessageView.this.mNextPrevObserver);
|
mPrevNextCursor.registerContentObserver(MessageView.this.mNextPrevObserver);
|
||||||
repositionPrevNextCursor();
|
repositionPrevNextCursor();
|
||||||
|
Loading…
Reference in New Issue
Block a user