protected void onRestart() {
super.onRestart();
LoadingImage.setVisibility(View.VISIBLE);
try {
URL url = new URL("http://192.168.11.30:4200/debug");
HttpURLConnection http = (HttpURLConnection) url.openConnection();
int statusCode = http.getResponseCode();
Log.d("test", "aaa" + statusCode);
// Toast.makeText(this, "onRestart" + statusCode, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.printStackTrace();
}
}
앱을 홈키눌러서 나갓다가 돌아올때 서버랑 statuscode체크를 해서 접속가능한지를 판단하고싶습니다.
눌렀다가 올라올때 코드가 int statusCode = http.getResponseCode(); 여기서 에러가나는데 이유가 알고 싶습니다. ㅜㅜ