I have simple volley request below. I want to fetch data from cache first, load the screen with this cache data after when fetching data from service, load same screen again.
RequestQueue queue = Volley.newRequestQueue(this);
StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
(Response.Listener<String>) response -> {
//success
}, (Response.ErrorListener) error -> {
//error
});
queue.add(stringRequest);
Is there any simple way.