diff options
Diffstat (limited to 'java/com/android/dialer/contactsfragment')
-rw-r--r-- | java/com/android/dialer/contactsfragment/ContactsFragment.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/java/com/android/dialer/contactsfragment/ContactsFragment.java b/java/com/android/dialer/contactsfragment/ContactsFragment.java index e62771837..41fa8f9c5 100644 --- a/java/com/android/dialer/contactsfragment/ContactsFragment.java +++ b/java/com/android/dialer/contactsfragment/ContactsFragment.java @@ -170,6 +170,10 @@ public class ContactsFragment extends Fragment fastScroller.updateContainerAndScrollBarPosition(recyclerView); int firstVisibleItem = manager.findFirstVisibleItemPosition(); int firstCompletelyVisible = manager.findFirstCompletelyVisibleItemPosition(); + if (firstCompletelyVisible == RecyclerView.NO_POSITION) { + // No items are visible, so there are no headers to update. + return; + } String anchoredHeaderString = adapter.getHeaderString(firstCompletelyVisible); // If the user swipes to the top of the list very quickly, there is some strange behavior |