Last active
January 11, 2020 13:04
-
-
Save shikto1/9a645252537faee4343faefebec98d90 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public class SingletonManager { | |
| private static SingletonManager mManager = null; | |
| public synchronized static SingletonManager getInstance(Context context) { | |
| if (mManager == null) { | |
| // Here i am using application context to avoid memory leak... | |
| mManager = new SingletonManager(context.getApplicationContext()); | |
| } | |
| return mManager; | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment