Created
January 13, 2014 19:10
-
-
Save bolhoso/8406165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.myapp; | |
import android.app.Application; | |
import com.android.volley.RequestQueue; | |
import com.android.volley.toolbox.Volley; | |
public class MyApplication extends Application { | |
private static RequestQueue requestQueue; | |
private static MyApplication appInstance = null; | |
public static MyApplication getInstance() { | |
return appInstance; | |
} | |
public MyApplication() { | |
super(); | |
appInstance = this; | |
} | |
public static synchronized RequestQueue getNetworkRequestQueue () { | |
if (MyApplication.requestQueue == null) { | |
MyApplication.requestQueue = Volley.newRequestQueue(appInstance); | |
} | |
return MyApplication.requestQueue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment