android - Can we use a EditText for creating hyperlinks? -


we can use textviewfor 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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -