With reference to the Question and Answer at - Android Volley + JSONObjectRequest Caching
I am implementing volley and facing issue of the cache (forced caching) at the APP end and am unable to do it.
Answer suggested by oleksandr_yefremov, is to create a method. I am unable to use that method. Can anybody help in understanding and to use is in fetching string from a url and cache it.
Here is the code suggested by oleksandr_yefremov
public class MyRequest extends com.android.volley.Request<MyResponse> {
...
@Override
protected Response<MyResponse> parseNetworkResponse(NetworkResponse response) {
String jsonString = new String(response.data);
MyResponse MyResponse = gson.fromJson(jsonString, MyResponse.class);
return Response.success(MyResponse, HttpHeaderParser.parseIgnoreCacheHeaders(response));
}
}
Please guide me to use it for string fetch and cache.
Thanks