Skip to content

Instantly share code, notes, and snippets.

@AliAsadi
Created May 31, 2019 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AliAsadi/d7a30944e66daa6dce3fa4953c124ed2 to your computer and use it in GitHub Desktop.
Save AliAsadi/d7a30944e66daa6dce3fa4953c124ed2 to your computer and use it in GitHub Desktop.
public class SingletonManager {
// ....
public synchronized static SingletonManager getInstance(Context context) {
if (singleton == null) {
singleton = new SingletonManager(context.getApplicationContext());
}
return singleton;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment