2
Я хочу изменить цвет ссылки по умолчанию (textview).Как изменить цвет clickable textview в android
SpannableString ss = new SpannableString("By continuing,I agree to HCP User Agreement and Terms of Services ");
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(View textView) {
startActivity(new Intent(UserRegister.this, ForgotPassword.class));
}
};
ss.setSpan(clickableSpan, 48, 65, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
TextView textView = (TextView) findViewById(R.id.termsAndConditions);
textView.setText(ss);
textView.setMovementMethod(LinkMovementMethod.getInstance());
'ss.setSpan (новый ForegroundColorSpan (Color.RED), 48,65, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)' – Raghunandan
у меня есть код, в котором они используют wordtoSpan.setSpan (новый ForegroundColorSpan (Color.BLUE), 15, 30, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); но затем, где я должен передать объект clickablespan – Loren
http://stackoverflow.com/questions/15851655/android-change-the-background-color-of-a-clickablespan-when-clicked –