Skip to content

Instantly share code, notes, and snippets.

@yagopv
Last active August 29, 2015 14:08
Show Gist options
  • Save yagopv/b5942027339e064cb7e0 to your computer and use it in GitHub Desktop.
Save yagopv/b5942027339e064cb7e0 to your computer and use it in GitHub Desktop.
Singleton Helper for Android
public class SingletonHelper {
private static SingletonHelper instance;
private static Context mContext = null;
public static SingletonHelper getInstance(Context context)
{
if (instance == null) {
instance = new SingletonHelper(context);
} else {
mContext = context;
}
return instance;
}
/**
* ctor
* @param context
*/
private SingletonHelper(Context context) {
mContext = context;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment