Reputation: 1856
I need to make somethink like this:
How can I select phone number with a blue color, and make on click listener on it? I don't want to create other textView for it. I tried:
@Override
public void onClick(View v) {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:+" + tv.getText().toString().trim()));
startActivity(callIntent);
}
Upvotes: 0
Views: 2060
Reputation: 3430
I haven't used it, but you can set a link mask for a textview so that it automatically creates clickable links of phone numbers (or email addresses or urls...) see http://developer.android.com/reference/android/widget/TextView.html#setAutoLinkMask(int) This probably just opens the system's default action and you can't add a clicklistener, but maybe that's what you need...?
Upvotes: 1