summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AutoExpandTextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/AutoExpandTextView.java')
-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 ea7ac896e..4dd419975 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);