0

I use Volley to return JSON from an API. I parse this JSON and add StoreItem objects to a List, then use an adapter to display in a listview.

I use the cache functionality in Volley, and I'm wondering how I can approach the issue of deleting/adding items. I know I'll need to make a POST/DELETE request with Volley to actually save/destroy the items in the database, but for user experience purposes I don't want to have to reload the view with a fresh Volley request. I also don't want the cache to update the view without recognizing the item that was just added/destroyed.

The android documentation for notifyDataSetChanged says:

Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself.

In this case is the underlying data the cache, my server database, or the Items in the list? Please let me know if I can clarify this question.

  • Are you using ArrayAdapter? – LordRaydenMK Jul 3 '14 at 8:11
  • Currently extending BaseAdapter, but may look into Array. – settheline Jul 3 '14 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.