Wednesday, April 10, 2013

Re: [android-developers] Highlight part of the text in a textview object

        TextView  textView = (TextView) ((MessageListItem)view).findViewById(R.id.text_view);
        int length = textView.getText().toString().length();
        Spannable str = (Spannable)textView.getText();
        str.setSpan(new BackgroundColorSpan(Color.RED), 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);


On Tuesday, April 20, 2010 1:13:34 AM UTC+5:30, Sebastian wrote:
the problem is that your solution is only for the font color, but i want to set the font background.... :(

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment