From 0d4c8685ae993896cff566be8023c51868bae405 Mon Sep 17 00:00:00 2001 From: Adrian Ulrich Date: Sun, 2 Jul 2017 15:41:13 +0200 Subject: [PATCH] handle NULLs in fastscroll alphabet. Display a question mark if the value was NULL, this enables the fastscroller to scroll to NULL columns. --- src/ch/blinkenlights/android/vanilla/MediaAdapter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ch/blinkenlights/android/vanilla/MediaAdapter.java b/src/ch/blinkenlights/android/vanilla/MediaAdapter.java index c7924665..7a3da334 100644 --- a/src/ch/blinkenlights/android/vanilla/MediaAdapter.java +++ b/src/ch/blinkenlights/android/vanilla/MediaAdapter.java @@ -70,7 +70,7 @@ public class MediaAdapter /** * The string to use for length==0 db fields */ - private static final String DB_NULLSTRING_FALLBACK = "???"; + private static final String DB_NULLSTRING_FALLBACK = "?"; /** * A context to use. */ @@ -686,11 +686,11 @@ public class MediaAdapter Object lastKnown = null; Object next; do { - if(cursor.isNull(sortColumnIndex)) - continue; - int type = cursor.getType(sortColumnIndex); switch (type) { + case Cursor.FIELD_TYPE_NULL: + next = DB_NULLSTRING_FALLBACK; + break; case Cursor.FIELD_TYPE_INTEGER: int value = cursor.getInt(sortColumnIndex); if (columnName.equals(MediaLibrary.SongColumns.MTIME)) {