commit | 29134bfe1712e58c31c68789247495e2efcc7fdb | [log] [tgz] |
---|---|---|
author | Walter Jang <wjang@google.com> | Thu Mar 24 11:39:12 2016 -0700 |
committer | Walter Jang <wjang@google.com> | Thu Mar 24 11:39:12 2016 -0700 |
tree | 39ee75c45b6ba4c7d6e10a5343beb88ce2b3a820 | |
parent | ef8ab805d2b114e9d0dd98ae067c056b4a09a377 [diff] |
Fix StaleDataException in changeCursor Check whether the cursor is closed before trying to getColumnIndex Bug 26926075 Change-Id: Iffb0694b153f39d871d536dd60113c0853af7211
diff --git a/common/java/com/android/common/widget/CompositeCursorAdapter.java b/common/java/com/android/common/widget/CompositeCursorAdapter.java index 03443d9..beae8ea 100644 --- a/common/java/com/android/common/widget/CompositeCursorAdapter.java +++ b/common/java/com/android/common/widget/CompositeCursorAdapter.java
@@ -220,7 +220,7 @@ prevCursor.close(); } mPartitions.get(partition).cursor = cursor; - if (cursor != null) { + if (cursor != null && !cursor.isClosed()) { mPartitions.get(partition).idColumnIndex = cursor.getColumnIndex("_id"); } invalidate();