Okhttp响应数据为NULL

时间:2016-08-01 16:42:36

标签: android okhttp

  @Override
  public void onResponse(String response, int id) {
       try {
           JSONObject pollresult = new JSONObject(response);
           List<OrderInfo> info = new Gson().fromJson(pollresult.getString("data"), new TypeToken<ArrayList<OrderInfo>>() {
           }.getType());
           orderId = info.get(0).getOrderID();
       } catch (JSONException e) {
            e.printStackTrace();
       }
 }

info.get(0)返回null,我得到NullPointerException

0 个答案:

没有答案