I have a textview created in a class B programaticly. When class A calls it.
It adds text say "I went to the shop" and i need the word "the" to be a link. This i have done using this in CLASS B
sb.setSpan(new MyClickableSpan(Word), start, start+Word.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
which is calling the class MyClickableSpan
public class MyClickableSpan extends ClickableSpan {
private String word;
public MyClickableSpan(String word) {
this.word = word;
}
@Override
public void onClick(View widget) {
Log.d("Spaannnned",word);
}
}
So when this link is clicked it is showing up in my log.
But I need it to run a function in Class A and pass in the word.
Please help