summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/BrowserHistoryPage.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/browser/BrowserHistoryPage.java')
-rw-r--r--src/com/android/browser/BrowserHistoryPage.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java
index 6ea2bffcd..44c26ecce 100644
--- a/src/com/android/browser/BrowserHistoryPage.java
+++ b/src/com/android/browser/BrowserHistoryPage.java
@@ -557,13 +557,13 @@ public class BrowserHistoryPage extends Fragment
@Override
public int getGroupCount() {
- return super.getGroupCount() + (mMostVisited != null ? 1 : 0);
+ return super.getGroupCount() + (!isMostVisitedEmpty() ? 1 : 0);
}
@Override
public int getChildrenCount(int groupPosition) {
if (groupPosition >= super.getGroupCount()) {
- if (mMostVisited == null) {
+ if (isMostVisitedEmpty()) {
return 0;
}
return mMostVisited.getCount();
@@ -576,6 +576,10 @@ public class BrowserHistoryPage extends Fragment
if (!super.isEmpty()) {
return false;
}
+ return isMostVisitedEmpty();
+ }
+
+ private boolean isMostVisitedEmpty() {
return mMostVisited == null
|| mMostVisited.isClosed()
|| mMostVisited.getCount() == 0;