Back to project page FragmentTutorial.
The source code is released under:
Apache License
If you think the Android project FragmentTutorial 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 com.yanlu.android.fragment.net; /*www. j a v a 2 s .co m*/ import android.content.Context; import com.android.volley.RequestQueue; import com.android.volley.toolbox.Volley; /** * Manager for the queue * * @author Trey Robinson * */ public class RequestManager { /** * the queue :-) */ private static RequestQueue mRequestQueue; /** * Nothing to see here. */ private RequestManager() { // no instances } /** * @param context * application context */ public static void init(Context context) { mRequestQueue = Volley.newRequestQueue(context); } /** * @return * instance of the queue * @throws * IllegalStateException if init has not yet been called */ public static RequestQueue getRequestQueue() { if (mRequestQueue != null) { return mRequestQueue; } else { throw new IllegalStateException("Not initialized"); } } }