0
나는 ListView에 결과를 표시하기 위해 PHP mysql travez에서 데이터베이스와 통신하고 있지만 3G 또는 WIFI가 있지만 응용 프로그램이 연결할 수 없으면 이전 Exception으로 돌아 가기 위해 ExeptionConnection을 구현하려고합니다. 토스트를 보여줘. 내 코드에서 구현하는 방법이 아니라면 JsonExeption 만 구현할 수있었습니다. 이 내 코드입니다 : url_list_rs 내 PHP의 URL입니다어떻게 구현 ConnectionException - 안드로이드
protected String doInBackground(String... args) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
JSONObject json = jParser.makeHttpRequest(url_list_rs, "GET",
params);
Log.d("All Products: ", json.toString());
try {
int success = json.getInt(TAG_SUCCESS);
if (success == 1) {
daftar_rs = json.getJSONArray(TAG_DAFTAR_RS);
for (int i = 0; i < list_rs.length(); i++) {
JSONObject c = list_rs.getJSONObject(i);
//Process Code
}
} else {
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
. ExeptionConnection을 어디에서 구현할 수 있습니까? 누구든지 도와 줄 수 있습니까? 마스터 감사합니다! 당신은 당신에게 자신의 예외를 만들려면