Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As of Android API level 8 there is a <a href="http://developer.android.com/reference/android/util/Patterns.html#WEB_URL" rel="nofollow">WEB_URL</a> pattern. Quoting the source, it "match[es] most part of RFC 3987". If you target a lower API level you could simply copy the pattern from the source and include it in your application. I assume you know how to use patterns and matchers, so I'm not going into more details here.</p> <p>Also the class <a href="http://developer.android.com/reference/android/webkit/URLUtil.html" rel="nofollow">URLUtil</a> provides some useful methods, e.g:</p> <p><a href="http://developer.android.com/reference/android/webkit/URLUtil.html#isHttpUrl%28java.lang.String%29" rel="nofollow">isHttpUrl()</a> <a href="http://developer.android.com/reference/android/webkit/URLUtil.html#isValidUrl%28java.lang.String%29" rel="nofollow">isValidUrl()</a> The descriptions of the methods are not very elaborate, therefore you are probably best of looking at the source and figuring out which one fits your purpose best.</p> <p>As for when to trigger the validation check, there are multiple possibilities: you could use the EditText callback functions</p> <p><a href="http://developer.android.com/reference/android/widget/TextView.html#onFocusChanged%28boolean,%20int,%20android.graphics.Rect%29" rel="nofollow">onFocusChanged()</a>, or <a href="http://developer.android.com/reference/android/widget/TextView.html#onTextChanged%28java.lang.CharSequence,%20int,%20int,%20int%29" rel="nofollow">onTextChanged()</a> or use a <a href="http://developer.android.com/reference/android/text/TextWatcher.html" rel="nofollow">TextWatcher</a>, which I think would be better.</p> <p>I hope this helps, best regards,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload