I am trying to recognise hashtags in my TextView and make them clickable such that I can take the user to another View when they click on the Hashtag.
I managed to i
You can achieve it by using split function and populate textview's in a Layout like this :
layout=(LinearLayout)findViewById(R.id.layout);
String data="I just watched #StarWars and it was incredible. It's a #MustWatch #StarWars";
TextView textView;
String [] s=data.split(" ");
for(int i=0;i
and a Method to handle click event to required Textview's :
View.OnClickListener viewClicked(final TextView textView) {
return new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(getApplicationContext(), v.getTag().toString(), 1000).show();
}
};
}