private boolean isValidUrl(String urlString) {
        boolean isUrl = false;
        try {
            URL url = new URL(urlString);
            URLConnection conn = url.openConnection();
            conn.connect();
            isUrl = true;
        } catch (MalformedURLException e) {
            // the URL is not in a valid form
        } catch (IOException e) {
            // the connection couldn't be established
        }
        return isUrl;
    }