This can be achieved using a Spannable String. You will need to import the following
import android.text.SpannableString; import android.text.style.BackgroundColorSpan; import android.text.style.StyleSpan;
And then you can change the background of the text using something like the following:
TextView text = (TextView) findViewById(R.id.text_login); text.setText(""); text.append("Add all your funky text in here"); Spannable sText = (Spannable) text.getText(); sText.setSpan(new BackgroundColorSpan(Color.RED), 1, 4, 0);
If it highlights the charecters at positions 1 - 4 with red. Hope this helps!
stealthcopter Apr 28 '10 at 17:19 2010-04-28 17:19
source share