Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SpannableString ss = new SpannableString("foo bar 2.00 foo foo");
- ClickableSpan clickableSpan = new ClickableSpan() {
- @Override
- public void onClick(View textView) {
- startActivity(new Intent(MyActivity.this, NextActivity.class));
- }
- @Override
- public void updateDrawState(TextPaint ds) {
- super.updateDrawState(ds);
- ds.setUnderlineText(false);
- }
- };
- ss.setSpan(clickableSpan, i, j, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); // where i and j should be the start and end index of your clickable string.
- textView.setText(ss);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement