Skip to content Skip to sidebar Skip to footer

Get Linkified Text From Textview-android...?

I have a textview in my android application. textView.setText(message); Linkify.addLinks(textView, Linkify.ALL); with this code it identify phone number,email address, web

Solution 1:

You can use TextView#getUrls after the call to Linkify like this:

URLSpan spans[] = textView.getUrls();
for(URLSpan span: spans) {
    Log.d(TAG, span.getURL());
}

Solution 2:

use textView.getUrls() . Then loop over this array and use URLSpan.getUrls() to get individual link

Post a Comment for "Get Linkified Text From Textview-android...?"