Check if a string is a Validate URL - Android Network

Android examples for Network:URL

Description

Check if a string is a Validate URL

Demo Code


//package com.java2s;

public class Main {
    public static boolean ValidateURL(String url) {
        try {/* w ww .  j a va  2  s  .c  om*/
            new java.net.URI(url);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

Related Tutorials