Validating URLs in Android
December 13th, 2011
Comments off
This is mostly just a reminder for myself. This morning I was checking to see if there was a simple way to validate URLs in Android and low and behold there is:
From: http://twigstechtips.blogspot.com/2011/10/android-validate-url-string.html
// Validate URL
if (!URLUtil.isValidUrl(url)) {
Toast.makeText(this, "Invalid URL specified", Toast.LENGTH_SHORT).show();
return;
}
Source: URLUtil.isValidUrl()
Categories: Programming