0

I need to start Volley Requests when various events happen in my application. For example when the activity starts (onCreate()) and when the user selects an item from a Spinner.

For this I created a method in my Activity which is supposed to return an ArrayList (for an Adapter). I create a new RequestQueue here, because (I think) it is a different queue. The problem is that the Request in the method just won't start no matter what I try. Simply adding it to the queue does not fire it and neither does start().

The Request in the onCreate() works fine with just adding it to its queue.

Is there no way to start it without a queue (or force it to start)? I don't see any reason why I would want to make a queue when these requests are not chained.

Martin Fejes
  • 677
  • 12
  • 20

1 Answers1

0

I think you don't need to create diferent queues. You should just add the requests to the same queue. The answer chosen in this question could help you.

What is the Maximum Size of the Volley-Library Request-Queue

Community
  • 1
  • 1
Álvaro Pérez Soria
  • 1,443
  • 1
  • 13
  • 26
  • I don't see how it could help me. My problem is that I want to run my requests separately anytime I need to. That's why I don't want to make one queue with both. – Martin Fejes Nov 18 '14 at 15:12
  • When you add your requests to the queue, it does not mean that they are not run until the previous one finishes. By default you can have 4 requests in parallel. – Álvaro Pérez Soria Nov 18 '14 at 15:21
  • I don't care if I can have a hundred requests. I want only 2 but I want them WHEN I want to run them. Not when the queue decides. I can't depend on something not in my control. – Martin Fejes Nov 18 '14 at 15:34