2

I'm using a Volley for Loading Images. However, I want to pause Image Download on listview fling.

Is there a way to pause/resume Request Queue in Volley.

Thanks.

Gaurav Arora
  • 17,124
  • 5
  • 33
  • 44

1 Answers1

3

Volley's RequestQueue has methods start() and stop() so it hould be called in onScrollStateChanged() method in next way:

if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_FLING) {
    mRequestQueue.stop();
} else {
    mRequestQueue.start();
}
oleg.semen
  • 2,901
  • 2
  • 28
  • 56
  • 1
    This is a heavy-weight solution, trading load image calls for nearly constant rescans of the cache directory. Check it out in DDMS, it is pretty brutal. –  Jul 24 '14 at 13:19
  • It causes stoping all request. Is there a way stopping the spesificied request? –  Jul 12 '17 at 16:12