diff options
author | Nancy Chen <nancychen@google.com> | 2014-08-15 13:05:33 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-08-15 13:05:33 -0700 |
commit | e93a23581cbb9da2282b5897ffc167f86836afae (patch) | |
tree | c009746225f7863444757e4251ad4c4115f72c05 | |
parent | c6344faeff899655abd60b3bf4cd638e58bcc3d7 (diff) | |
download | android_frameworks_ex-e93a23581cbb9da2282b5897ffc167f86836afae.tar.gz android_frameworks_ex-e93a23581cbb9da2282b5897ffc167f86836afae.tar.bz2 android_frameworks_ex-e93a23581cbb9da2282b5897ffc167f86836afae.zip |
Add public method to check if the partition is empty.
Currently the size of the partition is hidden from public. The isEmpty
method will allow outside classes to check if the partition does not
have any entries in it.
Bug: 15596340
Change-Id: I0a0f8f7c7a350b802e58e9138801c13b6e74a059
-rw-r--r-- | common/java/com/android/common/widget/CompositeCursorAdapter.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/java/com/android/common/widget/CompositeCursorAdapter.java b/common/java/com/android/common/widget/CompositeCursorAdapter.java index 114065f..dddbcf6 100644 --- a/common/java/com/android/common/widget/CompositeCursorAdapter.java +++ b/common/java/com/android/common/widget/CompositeCursorAdapter.java @@ -54,6 +54,10 @@ public abstract class CompositeCursorAdapter extends BaseAdapter { public boolean getHasHeader() { return hasHeader; } + + public boolean isEmpty() { + return count == 0; + } } private final Context mContext; @@ -110,7 +114,7 @@ public abstract class CompositeCursorAdapter extends BaseAdapter { /** * Removes cursors for all partitions. */ - // TODO: Is this really what this is supposed to do? Just remove the cursors? Not close them? + // TODO: Is this really what this is supposed to do? Just remove the cursors? Not close them? // Not remove the partitions themselves? Isn't this leaking? public void clearPartitions() { |