android - Can we use a EditText for creating hyperlinks? -
we can use textview
for adding hyperlinks various methods, using attribute autolink, or using setmovementmethod()
.
can same using , edittext
widget? trying create notepad, in if such text entered, url, email, number or similar, should hyperlink click on , open browser.
please help.
thanks all.
as of android api level 8 there web_url pattern. quoting source, "match[es] part of rfc 3987". if target lower api level copy pattern source , include in application. assume know how use patterns , matchers, i'm not going more details here.
also class urlutil provides useful methods, e.g:
ishttpurl() isvalidurl() descriptions of methods not elaborate, therefore best of looking @ source , figuring out 1 fits purpose best.
as when trigger validation check, there multiple possibilities: use edittext callback functions
onfocuschanged(), or ontextchanged() or use textwatcher, think better.
i hope helps, best regards,
Comments
Post a Comment