Back to project page pokedex.
The source code is released under:
MIT License
If you think the Android project pokedex 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.andrescanales.pokedex; /* w w w .j a v a2s. c o m*/ /** * Created by andrescanales on 10/31/14. */ import android.app.Application; import android.text.TextUtils; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.Volley; public class PokedexApplication extends Application { public static final String TAG = PokedexApplication.class .getSimpleName(); private RequestQueue mRequestQueue; private static PokedexApplication mInstance; @Override public void onCreate() { super.onCreate(); mInstance = this; } public static synchronized PokedexApplication getInstance() { return mInstance; } public RequestQueue getRequestQueue() { if (mRequestQueue == null) { mRequestQueue = Volley.newRequestQueue(getApplicationContext()); } return mRequestQueue; } public <T> void addToRequestQueue(Request<T> req, String tag) { req.setTag(TextUtils.isEmpty(tag) ? TAG : tag); getRequestQueue().add(req); } public <T> void addToRequestQueue(Request<T> req) { req.setTag(TAG); getRequestQueue().add(req); } public void cancelPendingRequests(Object tag) { if (mRequestQueue != null) { mRequestQueue.cancelAll(tag); } } }