SHARE
TWEET

Untitled

a guest Dec 31st, 2012 442 Never
  1.         SpannableStringBuilder builder = new SpannableStringBuilder();
  2.         String red = "I am RED ";
  3.         SpannableString redSpannable= new SpannableString(red);
  4.         redSpannable.setSpan(new ForegroundColorSpan(Color.RED), 0, red.length(), 0);
  5.         builder.append(redSpannable);
  6.        
  7.         EditText et = (EditText)findViewById(R.id.editText1);
  8.         et.setText(builder, BufferType.SPANNABLE);
  9.        
  10.         int position = et.length();
  11.         Editable etext = et.getText();
  12.         Selection.setSelection(etext, position);
RAW Paste Data
Top