如何在android中更改可点击文本视图的颜色

时间:2015-08-27 06:58:06

标签: android textview

我想更改链接的默认颜色(textview)。

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());

0 个答案:

没有答案
相关问题