I have an Android application with multiple REST Api\'s. The API\'s are managed using the Volley library. The response is getting and it\'s woking fine. But when I make asyn
The tag you assign to a Request is stored to the variable mTag which is persisted throughout the life cycle of the Request.
public Request> setTag(Object tag) {
mTag = tag;
return this;
}
For my applications I have slightly modified the following Volley classes:
In class Request change visibility of mTag from private to protected
/** An opaque token tagging this request; used for bulk cancellation. */
protected Object mTag;
In class Response, add Object tag to the callback function onResponse defined in interface Listener
/** Callback interface for delivering parsed responses. */
public interface Listener {
/** Called when a response is received. */
public void onResponse(Object tag, T response);
}
In classes which implement interface Response.Listener, like JsonRequest
@Override
protected void deliverResponse(T response) {
mListener.onResponse(mTag, response);
}