summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-05-30 09:20:48 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-05-30 09:20:49 -0700
commit590a5428d6ff905e9ffb21f3451121353f94327c (patch)
treefcab514fcec112233ab096bc7b27d37d65d1ac2d
parent442063196f524a2a42a6f1c93aa2b224c821ad3e (diff)
parent6f82efcfc934f13b7774a05c8d5ed9fafa2c4fca (diff)
downloadMms-590a5428d6ff905e9ffb21f3451121353f94327c.tar.gz
Merge "Make the liftcycle of cursor under the Activity"
-rw-r--r--src/com/android/mms/ui/ComposeMessageActivity.java7
-rw-r--r--src/com/android/mms/ui/ConversationList.java7
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);
}