2

Basic explanation I'm currently using Volley for a part of my application. Since I'm already using it and enjoying the wise HTTP requests, I was wondering if there's a way to make a Volley.Request without a RequestQueue.

I've been searching the web for a while, even going through Volley's source, Google I/O.

Further explanation: I have another Activity which onCreate I'd like to fetch data about it. I wanted to execute only one Request, I don't need the entire Queue..

I thought of some implementations:
1. make a Singleton class with RequestQueue that I'll call add from each Activity I need (I don't think that's the best idea..).
2. Use RequestQueue in every Activity I need (I also don't think it's the best idea).
3. Create my own Request class and implement my own HTTP execute.
4. according to this, I can instantiate the RequestQueue with the Application and just add to queue from each Activity.. but since the Request won't happen immidiately (so I believe), I don't think that's the best idea - please correct me if I'm wrong.

My question is: is there a way to asynchronously start a single Request without RequestQueue? if not, which is the best option from my implementations? if none, please suggest another.

Thank you.

Community
  • 1
  • 1
user2558461
  • 281
  • 1
  • 6
  • 21

1 Answers1

0
  1. is right option. Remember that you can place onResponse at the same activity / code where the request is and handle asynchronous behaviour this way.
maxxxo
  • 672
  • 3
  • 10
  • 28