How to intents (sent to other activity) part of string from textview? like this image :
I already settext on textview like this:
lbl_checkback_tommorow = (TextView) findViewById(R.id.lbl_checkback_tommorow);
final String update_profile = "update your profile";
final String hot_news = "Hot news?";
lbl_checkback_tommorow.setText("Check back tommorow,\n and you should be ready to start booking your workout. While you wait, would you want to "+update_profile+", or read some of the interesting posts we have in our "+hot_news);
How to make update_profile and hot_news clickable (go to another activity)?
Update: Clickable span like this:
SpannableString update_profile = new SpannableString("update your profile");
SpannableString hot_news = new SpannableString("Hot news?");
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(View textView) {
startActivity(new Intent(MyActivity.this, NextActivity.class));
}
@Override
public void updateDrawState(TextPaint ds) {
super.updateDrawState(ds);
ds.setUnderlineText(false);
}
};
update_profile.setSpan(clickableSpan, 118, 215, 234, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
hot_news.setSpan(clickableSpan, 118, 215, 234, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
SpannableStringBuilder builder = new StringBuilder("Check back tommorow,\n and you should be ready to start booking your workout. While you wait, would you want to "+update_profile+", or read some of the interesting posts we have in our "+hot_news);
lbl_checkback_tommorow = (TextView) findViewById(R.id.lbl_checkback_tommorow);
lbl_checkback_tommorow.setText(builder);