0

I have implemented : http://www.androidhive.info/…/android-custom-listview-with…/ The thing I want is to use the fetched listView offline. Basically I want to cache it and use it when not connected to internet.

1 Answers1

0

While making the request through volley, set the setShouldCache to true.

StringRequest req = new StringRequest(..................);

req.setShouldCache(true);

For what time the data will remain in cache ?

It seems that currently the cache expiration is controlled solely by the "Cache" headers in the response so basically you are left to the mercy of the server. Whatever server returns in the "Expires" or "max-age=" that will be used. We will have to use our own cache if we need custom expiry policy... ( Set expiration policy for cache using Google's Volley )

Community
  • 1
  • 1
Nishant Chauhan
  • 726
  • 7
  • 17