I have a Spannable Object
with a Clickable Object
set to it. When the Spannable String
is displayed in the TextView
it has bl
simplest way is
string1 = new SpannableString("By Tapping Register You Agree To The \nTerms And Conditions");
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(View widget) {
Toast.makeText(getApplicationContext(),"clicked",Toast.LENGTH_SHORT).show();
}
@Override
public void updateDrawState(TextPaint ds) {
ds.setUnderlineText(false); // this line removes underline
}
};
text_terms.setMovementMethod(LinkMovementMethod.getInstance());
string1.setSpan(clickableSpan,37,string1.length(),0);
text_terms.setText(string1);