FileDocCategorySizeDatePackage
JsonArrayRequest.javaAPI DocAndroid 5.1 API2099Thu Mar 12 22:22:56 GMT 2015com.android.volley.toolbox

JsonArrayRequest

public class JsonArrayRequest extends JsonRequest
A request for retrieving a {@link JSONArray} response body at a given URL.

Fields Summary
Constructors Summary
public JsonArrayRequest(String url, com.android.volley.Response.Listener listener, com.android.volley.Response.ErrorListener errorListener)
Creates a new request.

param
url URL to fetch the JSON from
param
listener Listener to receive the JSON response
param
errorListener Error listener, or null to ignore errors.

        super(Method.GET, url, null, listener, errorListener);
    
Methods Summary
protected com.android.volley.ResponseparseNetworkResponse(com.android.volley.NetworkResponse response)

        try {
            String jsonString =
                new String(response.data, HttpHeaderParser.parseCharset(response.headers));
            return Response.success(new JSONArray(jsonString),
                    HttpHeaderParser.parseCacheHeaders(response));
        } catch (UnsupportedEncodingException e) {
            return Response.error(new ParseError(e));
        } catch (JSONException je) {
            return Response.error(new ParseError(je));
        }