1

I have a text with some words which if we click on and move to other activities. I tried to search a lot from internet or stack overflow. Is there any technique to solve this issue?

Thanks and best regards

Ankata
  • 101
  • 3
  • 12

2 Answers2

3

If it's about specific words inside a bigger piece of text, mark the clickable words as URLSpan and override the URLSpan's onClick(View widget) method to start the new Activity - by default it will fire off on Intent.ACTION_VIEW. I'm sure you'll be able to find multiple examples if you do a search here on SO.

If you also want to remove the underline that is inherent to the URLSpan, have a look at this answer.

Community
  • 1
  • 1
MH.
  • 45,303
  • 10
  • 103
  • 116
  • I think this link is good http://www.chrisumbel.com/article/android_textview_rich_text_spannablestring – Ankata May 04 '12 at 04:46
-2

simply setOnClickListener on TextView

textView.setOnClickListener(new OnClikListener(){
public void onClick(View v){
//here call your activity
}

});
Zaz Gmy
  • 4,236
  • 3
  • 19
  • 30