I want to underline a text view text and change the color of the underline as blue.I have done that but my code is changing the color of the text view as well as the underline.I want to change the color of the underline only.How can we do this.
TextView tv = (TextView) findViewById(R.id.tv);
SpannableString content = new SpannableString(tv.getText().toString());
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
content.setSpan(new ForegroundColorSpan(Color.BLUE), 0, content.length(), 0);
tv.setText(content);