What is the outcome you want for the click?
The simplest way to do this would be to apply a URLSpan
onto the TextView's contents, but if you want to do something other than view a webpage you can implement your own version of ClickableSpan
and make the click do whatever you want.
Edit per your comment:
Making a ClickableSpan go to another activity is really easy, here's the start of the code you'd need for it:
public class MyURLSpan extends ClickableSpan {
Class<?> mClassToLaunch;
public MyURLSpan(Class<?> classToLaunch) {
mClassToLaunch = classToLaunch;
}
@Override
public void onClick(View widget) {
Intent intent = new Intent(widget.getContext(), mClassToLaunch);
widget.getContext().startActivity(intent);
}
@Override
public void updateDrawState(TextPaint ds) {
// If you don't want the default drawstate (blue-underline), comment this super call out.
super.updateDrawState(ds);
}
}
Then to use it:
String longText = "your text goes here...";
SpannableString textViewContents = new SpannableString(longText);
textViewContents.setSpan(new MyURLSpan(NextActivity.class), indexToStart, lengthOfClickArea, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
myTextView.setText(textViewContents);