you can achieve this with SpannableString and ClickableSpan.
For this you need the indices of the substring you want to make clickable (sadly i haven't yet figured out an efficient way of how to get the indices right). You can even set multiple clickableSpans to one String.
Try something like this:
SpannableString text;
ClickableSpan clickMe;
public void onCreate(...){
text = new SpannableString(yourText);
clickMe = new ClickableSpan(){
@Override
public void onClick(View textView){
// Your ClickEvent
}
};
text.setSpan(clickMe, startIndexOfSubstring, EndIndexOfSubstring, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
Then you just need to apply that text to your TextView or Item in your ListView and it will be clickable.
I sadly have no experience with this Method in ListViews, but in TextViews this worked fine for me. You have to set this too:
yourTextView.setMovementMethod(LinkMovementMethod.getInstance());
Hope this helped you somehow!