Back to project page android-checkers-app.
The source code is released under:
Apache License
If you think the Android project android-checkers-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.unlv.sudo.checkers.util; //w ww.j a v a 2 s . co m import com.android.volley.RequestQueue; import com.android.volley.toolbox.Volley; import edu.unlv.sudo.checkers.CheckersApplication; /** * This manages the request queue for Volley. */ public class VolleySingleton { private static VolleySingleton instance; private RequestQueue requestQueue; private VolleySingleton() { requestQueue = Volley.newRequestQueue(CheckersApplication.getAppContext()); requestQueue.start(); } /** * @return the instance of the {@link VolleySingleton}. */ public static VolleySingleton getInstance() { return instance == null ? instance = new VolleySingleton() : instance; } /** * @return the {@link RequestQueue} for this singleton. */ public RequestQueue getRequestQueue() { return this.requestQueue; } @Override protected void finalize() throws Throwable { requestQueue.stop(); super.finalize(); } }