Android. Volley. Why some methods are not called?

There is such code:
public void loadMyInventory(final Map<string, string> options, final Callback callback) {
 Log.d(TAG, "loadMyInventory:" + url);
 JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url,
 new Response.Listener<jsonobject>() {
@Override
 public void onResponse(JSONObject response) {
 try {
callback.onResult(SteamItemRepository.fromJSONObject(response));
 } catch (JSONException e) {
 callback.onError(new Error("Error reading data"));
}
}
 }, new Response.ErrorListener() {
@Override
 public void onErrorResponse(VolleyError error) {
 Log.d(TAG, "onErrorResponse:" + error.networkResponse);
 callback.onError(new Error(error));
}
 }) {
@Override
 protected Response<jsonobject> parseNetworkResponse(NetworkResponse response) {
 Log.d(TAG, "parseNetworkResponse:" + new String(response.data));
 return super.parseNetworkResponse(response);
}
@Override
 protected Map<string, string> getParams() throws AuthFailureError {
 Log.d(TAG, "getParams: ");
 Map<string, string> params = new HashMap<>();
 params.put("l", "russian"); // Language
 params.put("trading", "1"); // Just for sharing
 return params;
}
@Override
 public Map<string, string> getHeaders() throws AuthFailureError {
 Log.d(TAG, "getHeaders: ");
 Map<string, string> headers = new HashMap<>();
 headers.put("Cookie", mSteamCookie);
 return headers;
}
};
mRequestQueue.add(request);
callback.onStart();
 }</string></string></string></string></jsonobject></jsonobject></string>

In the logs says only that:
06-07 12:55:21.893 5843-5843/my.package. D/Steam: loadMyInventory: https://steamcommunity.com/my/inventory/json/730/2/
06-07 12:55:21.903 5843-6161/my.package. D/Steam: getHeaders: 
06-07 12:55:23.635 5843-5843/my.package. D/Steam: onErrorResponse: null

That is, methods parseNetworkResponse and getParams are not invoked. Same thing when you create a new class:
public class SteamJsonObjectRequest extends JsonObjectRequest {

 public static final String TAG = "SteamJsonObjectRequest";

 public SteamJsonObjectRequest(int method, String url, Response.Listener<jsonobject> listener, Response.ErrorListener errorListener) {
 super(method, url, listener, errorListener);
 Log.d(TAG, "SteamJsonObjectRequest: ");
}

@Override
 protected Response<jsonobject> parseNetworkResponse(NetworkResponse response) {
 Log.d(TAG, "parseNetworkResponse:" + new String(response.data));
 return super.parseNetworkResponse(response);
}

@Override
 protected Map<string, string> getParams() throws AuthFailureError {
 Log.d(TAG, "getParams: ");
 return super.getParams();
}

}</string></jsonobject></jsonobject>

What can be the reason?
July 8th 19 at 16:05
1 answer
July 8th 19 at 16:07
It is obvious that these methods are simply not used.
Why then invoke the method parseNetworkResponse from JsonObjectRequest? - brando commented on July 8th 19 at 16:10
: well, I know. See the code. If those method calls are initiated by your code, and they must be called, then debug and stacktrace to help you. If you're trying to slip their code third-party library, then you need to see the source code of third party libraries. Maybe these methods are not used in General. - hank51 commented on July 8th 19 at 16:13

Find more questions by tags AndroidJava