Assigning text color to text in EditText

android, android-widget

Solution

use spans:

TextView textView = (TextView)findViewById(R.id.mytextview01);
Spannable WordtoSpan = new SpannableString("partial colored text");        
WordtoSpan.setSpan(new ForegroundColorSpan(Color.BLUE), 2, 4, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(WordtoSpan);

Problem

How do I assign a different color to text in EditText by extending it?

Original source