OSDN Git Service

Do not use the Cursor if it is closed.
authorLeon Scroggins <scroggo@google.com>
Tue, 8 Dec 2009 16:15:36 +0000 (11:15 -0500)
committerLeon Scroggins <scroggo@google.com>
Tue, 8 Dec 2009 16:15:36 +0000 (11:15 -0500)
Fixes http://b/issue?id=2307930

src/com/android/browser/BrowserHistoryPage.java

index bdd109b..2eab181 100644 (file)
@@ -418,6 +418,8 @@ public class BrowserHistoryPage extends ExpandableListActivity {
             } else {
                 item = (HistoryItem) convertView;
             }
+            // Bail early if the Cursor is closed.
+            if (mCursor.isClosed()) return item;
             int index = childPosition;
             for (int i = 0; i < groupPosition; i++) {
                 index += mItemMap[i];
@@ -515,7 +517,7 @@ public class BrowserHistoryPage extends ExpandableListActivity {
         }
 
         public boolean isEmpty() {
-            return mCursor.getCount() == 0;
+            return mCursor.isClosed() || mCursor.getCount() == 0;
         }
     }
 }