ImageSpan in a widget?
<p>Are there any limitations to adding an ImageSpan to a widget?
This identical code works fine in a standard TextView.</p>

<pre><code>SpannableStringBuilder buf = new SpannableStringBuilder("");
if(!TextUtils.isEmpty(message.getMessageBody())) {
    SmileyParser parser = SmileyParser.getInstance();
    buf.append(parser.addSmileySpans(group ? message.getMessageBodyWithoutName() : message.getMessageBody()));
}
view.setTextViewText(R.id.message_body, buf);
</code></pre>

<p>Thanks.</p>

<p>Edit 1: </p>

<pre><code>public CharSequence addSmileySpans(CharSequence text) {
SpannableStringBuilder builder = new SpannableStringBuilder(text);

Matcher matcher = mPattern.matcher(text);
while (matcher.find()) {
    int resId = mSmileyToRes.get(matcher.group());
    builder.setSpan(new ImageSpan(mContext, resId),
                    matcher.start(), matcher.end(),
                    Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return builder;
</code></pre>

<p>}</p>
