Is there a way to have a Linkify
'd link call a method in my Activity
or am I only allowed to use Linkify
to create links to other activities / apps etc.?
views:
59answers:
1
A:
Nope. Linkify comes with:
EMAIL_ADDRESSES
MAP_ADDRESSES
PHONE_NUMBERS
WEB_URLS
You can try extending it. Here's the src code.
Macarse
2010-07-12 15:51:45
that's not totally true, you can create links to custom urls and match on things other than what you mentioned using Linkify.addLinks(holder.messageText, myRegexPattern, "content://com.my.app/people/?url=",null, new MyLinkTransform(msg.getUrl()));
Ben
2010-07-12 15:58:48
@Ben: You are right. What I try to say is that it brings that by default. I will modify my answer.
Macarse
2010-07-12 16:15:55
I wish they had an api similar to the webview (webview.setJavascriptInterface()) where i could essentially tack-on my own custom java code when they click on the link...
Ben
2010-07-12 16:49:46