String[] urls = {some urls...};
URL url;
HttpURLConnection http;
String goodResult = "";
for (String s : urls) {
url = new URL(s);
http = (HttpURLConnection) url.openConnection();
if (http.getResponseCode() == HttpURLConnection.HTTP_OK) {
goodResult = s;
break;
}
}