我有一个使用Volley Library执行GET请求的方法
public void get(String url) {
// Request a string response from the provided URL.
StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
System.out.println("Successfull response is: " + response);
}
}, createMyReqErrorListener()) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<>();
headers.put(ACCEPT, ACCEPT_JSON);
headers.put(AUTH_ID, AUTH_ID_VALUE);
headers.put(PLATFORM, PLATFORM_VALUE);
headers.put(CID, "");
System.out.println(headers.toString());
return headers;
}
};
// Add the request to the RequestQueue.
queue.add(stringRequest);
}
在onResponse Override方法中,我希望将响应对象传递到我的解析器中,该解析器位于数据类中,然后将解析后的信息(图像/名称等)传递给活动,以便它可以显示它? / p>
我怎么能把对象传递给链?