I'm trying to make a TV based android application that was running on android box, but suddenly when I pull the LAN connection from it so the connection was lost the JSONParser.getJSONObject will crash and the weird one is that it does not throw any exception from crashing. Here is my code for JSON parsing.
public void checkData(String url) {
try {
final JSONParser jParser = new JSONParser();
String result = jParser.getJSONFromUrl(url);
JSONObject json = (JSONObject) new JSONTokener(result).nextValue();
JSONObject retObj = json.getJSONObject("error");
String errorStr = retObj.getString("code");
errView = (TextView) act.findViewById(R.id.error401msg);
errView.setText(errorStr);
} catch (JSONException e) {
System.out.println("Error401::JSON Error: " + e);
} catch (RuntimeException err) {
System.out.println("Error401::Runtime Error: " + err);
} catch (Exception e) {
System.out.println("Error401::Exception: " + e);
}
}