is Url Valid String - Android Network

Android examples for Network:URL

Description

is Url Valid String

Demo Code


//package com.java2s;

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static boolean isUrlValid(String url) {
        try {/*from   w w  w  . ja  v a2 s .  co m*/
            new URL(url);
            return true;
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        return false;
    }
}

Related Tutorials