From c1d9be5dc36f64b104fcaf041dd38c28ed4d05a0 Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Thu, 10 Nov 2011 15:17:46 -0800 Subject: [PATCH] Fix bug 5594054 Crash seen while syncing Exchange bug 5594054 Change-Id: Id14598c4da66c0f2c78a7c892f653b6cee781f3b --- src/com/android/email/activity/MessageListItem.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/activity/MessageListItem.java b/src/com/android/email/activity/MessageListItem.java index fb19b2dcc..cb5635f85 100644 --- a/src/com/android/email/activity/MessageListItem.java +++ b/src/com/android/email/activity/MessageListItem.java @@ -313,17 +313,19 @@ public class MessageListItem extends View { return; } boolean hasSubject = false; + int snippetStart = 0; if (!TextUtils.isEmpty(mSubject)) { int subjectColor = getFontColor(mRead ? SUBJECT_TEXT_COLOR_READ : SUBJECT_TEXT_COLOR_UNREAD); mText.setSpan(new ForegroundColorSpan(subjectColor), 0, mSubject.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + snippetStart = mSubject.length() + 1; } if (!TextUtils.isEmpty(mSnippet)) { int snippetColor = getFontColor(mRead ? SNIPPET_TEXT_COLOR_READ : SNIPPET_TEXT_COLOR_UNREAD); - mText.setSpan(new ForegroundColorSpan(snippetColor), mSubject.length() + 1, mText - .length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + mText.setSpan(new ForegroundColorSpan(snippetColor), snippetStart, mText.length(), + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } }