我正在嘗試通過android button click
進行web服務調用。我已經設法糾正錯誤,但它顯示了一些錯誤獲得迴應。我收到null
迴應。以下是我的代碼。有人可以調試我請.. ..!提前致謝。調用android按鈕單擊方法
我的代碼:
refresh_btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
HttpHandler httpHandler1 = new HttpHandler();
String res = null;
String authToken = "MlSyULrWlFgVk28";
try {
Log.d("edwLog", TAG + " get_payment_notifications " + HttpHandler.API_URL + "get_payment_notifications/" + authToken + "/");
res = httpHandler1.makeServiceCall(HttpHandler.API_URL + "get_payment_notifications/" + authToken + "/", HttpHandler.GET);
Log.d("edwLog", TAG + " response > " + res);
if (res != null) {
JSONObject jsonObject = new JSONObject(res);
String responseType = jsonObject.getString("type");
if (responseType.equals("success")) {
if (jsonObject.has("response")) {
JSONArray jsonArray = jsonObject.getJSONArray("response");
for (int i = 0; i < jsonArray.length(); i++) {
notifications.add(jsonArray.getJSONObject(i));
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
Log.d("edwLog", TAG + " IOException > " + e.toString());
}
}
});
logcat log在哪裏? –
這究竟是什麼? :'final Bundle result = new Bundle(); 返回結果;'結果是沒有! –
是的,這就是我觸及Skizo .. – sam