package net.solutinno.util;

import android.util.Patterns;

import java.net.URL;

public class UrlHelper
{
    public static boolean isUrlValid(String url) {
        try { new URL(url); return Patterns.WEB_URL.matcher(url).matches(); } catch (Exception ex) { return false; }
    }
}

@@ -273,11 +273,189 @@
  %7D%0A    %7D
+%0A%0A    public static URL getUrlFromString(String url) %7B%0A        if (!isUrlValid(url)) return null;%0A        try %7B return new URL(url); %7D catch (Exception ex) %7B return null; %7D%0A    %7D
 %0A%7D%0A

Add getUrlFromString function to UrlHelper