summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/launcher3/AutoExpandTextView.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/com/android/launcher3/AutoExpandTextView.java b/src/com/android/launcher3/AutoExpandTextView.java
index ea7ac89..4dd4199 100644
--- a/src/com/android/launcher3/AutoExpandTextView.java
+++ b/src/com/android/launcher3/AutoExpandTextView.java
@@ -197,11 +197,14 @@ public class AutoExpandTextView extends TextView {
SpannableStringBuilder builder = new SpannableStringBuilder();
for (HighlightedText highlightText : sections) {
- SpannableString spannable = new SpannableString(highlightText.mText.substring(0, 1));
- spannable.setSpan(
- new ForegroundColorSpan(highlightText.mHighlight ? highlightColor : grayColor),
- 0, spannable.length(), 0);
- builder.append(spannable);
+ if (!TextUtils.isEmpty(highlightText.mText)) {
+ SpannableString spannable =
+ new SpannableString(highlightText.mText.substring(0, 1));
+ spannable.setSpan(
+ new ForegroundColorSpan(highlightText.mHighlight ? highlightColor :
+ grayColor), 0, spannable.length(), 0);
+ builder.append(spannable);
+ }
}
setText(builder);