Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. SpannableString ss = new SpannableString("foo bar 2.00 foo foo");
  2. ClickableSpan clickableSpan = new ClickableSpan() {
  3. @Override
  4. public void onClick(View textView) {
  5. startActivity(new Intent(MyActivity.this, NextActivity.class));
  6. }
  7. @Override
  8. public void updateDrawState(TextPaint ds) {
  9. super.updateDrawState(ds);
  10. ds.setUnderlineText(false);
  11. }
  12. };
  13. ss.setSpan(clickableSpan, i, j, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); // where i and j should be the start and end index of your clickable string.
  14. textView.setText(ss);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement