diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2012-05-30 09:20:48 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-05-30 09:20:49 -0700 |
commit | 590a5428d6ff905e9ffb21f3451121353f94327c (patch) | |
tree | fcab514fcec112233ab096bc7b27d37d65d1ac2d | |
parent | 442063196f524a2a42a6f1c93aa2b224c821ad3e (diff) | |
parent | 6f82efcfc934f13b7774a05c8d5ed9fafa2c4fca (diff) | |
download | Mms-590a5428d6ff905e9ffb21f3451121353f94327c.tar.gz |
Merge "Make the liftcycle of cursor under the Activity"
-rw-r--r-- | src/com/android/mms/ui/ComposeMessageActivity.java | 7 | ||||
-rw-r--r-- | src/com/android/mms/ui/ConversationList.java | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/mms/ui/ComposeMessageActivity.java b/src/com/android/mms/ui/ComposeMessageActivity.java index 4fa1878e..cb5b634b 100644 --- a/src/com/android/mms/ui/ComposeMessageActivity.java +++ b/src/com/android/mms/ui/ComposeMessageActivity.java @@ -2090,6 +2090,13 @@ public class ComposeMessageActivity extends Activity mConversation.blockMarkAsRead(false); if (mMsgListAdapter != null) { + // Close the cursor in the ListAdapter if the activity stopped. + Cursor cursor = mMsgListAdapter.getCursor(); + + if (cursor != null && !cursor.isClosed()) { + cursor.close(); + } + mMsgListAdapter.changeCursor(null); } diff --git a/src/com/android/mms/ui/ConversationList.java b/src/com/android/mms/ui/ConversationList.java index abd05176..80fc4217 100644 --- a/src/com/android/mms/ui/ConversationList.java +++ b/src/com/android/mms/ui/ConversationList.java @@ -281,6 +281,13 @@ public class ConversationList extends ListActivity implements DraftCache.OnDraft // multi-select mode (if we're in it) and remove all the selections. getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL); + // Close the cursor in the ListAdapter if the activity stopped. + Cursor cursor = mListAdapter.getCursor(); + + if (cursor != null && !cursor.isClosed()) { + cursor.close(); + } + mListAdapter.changeCursor(null); } |