i am trying to loop something so that it will restart after a few minutes.
here is my code
private static boolean online = false;
public static boolean isStreamLive() {
{ firstloop: if(online == false) {
try {
URL url = new URL( insertChannel(TWITCH_STREAM, "nyankosaan") );
URLConnection conn = url.openConnection();
BufferedReader br = new BufferedReader( new InputStreamReader( conn.getInputStream() ));
String inputLine = br.readLine();
br.close();
JsonObject jsonObj = JsonObject.readFrom(inputLine);
return ( jsonObj.get("stream").isNull() )?false:true;
}
catch (IOException e)
{
e.printStackTrace();
}
} else {
if(isStreamLive() == true);
try {
continue;
} finally {
}
}
return online;
}
}
}
for some reason the continue has an error saying "continue cannot be used outside of a loop". can anyone help me figure out why its saying that?