diff options
author | Jay Shrauner <shrauner@google.com> | 2015-04-02 14:49:52 -0700 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2015-04-02 14:49:52 -0700 |
commit | 62e75fbd7d174d511e35a19a882a249490daa2cd (patch) | |
tree | bb4884ec1be822bcbd3b86c127d1f80bdae3c01d | |
parent | d9e79df27877ea2b7bf55044f4bde687f28a6ac5 (diff) | |
download | android_frameworks_ex-62e75fbd7d174d511e35a19a882a249490daa2cd.tar.gz android_frameworks_ex-62e75fbd7d174d511e35a19a882a249490daa2cd.tar.bz2 android_frameworks_ex-62e75fbd7d174d511e35a19a882a249490daa2cd.zip |
Fix StaleDataException in isPartitionEmpty
Check whether the cursor is closed before querying getCount()
Bug:20052582
Change-Id: I4f205cba25428a95d8416d7f7bcedbda40d622c4
-rw-r--r-- | common/java/com/android/common/widget/CompositeCursorAdapter.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/java/com/android/common/widget/CompositeCursorAdapter.java b/common/java/com/android/common/widget/CompositeCursorAdapter.java index 8a3fa9b..03443d9 100644 --- a/common/java/com/android/common/widget/CompositeCursorAdapter.java +++ b/common/java/com/android/common/widget/CompositeCursorAdapter.java @@ -233,7 +233,7 @@ public abstract class CompositeCursorAdapter extends BaseAdapter { */ public boolean isPartitionEmpty(int partition) { Cursor cursor = mPartitions.get(partition).cursor; - return cursor == null || cursor.getCount() == 0; + return cursor == null || cursor.isClosed() || cursor.getCount() == 0; } /** |