Created
March 1, 2017 22:32
-
-
Save tylergets/cb3689fa0455f84e5547f104592cf999 to your computer and use it in GitHub Desktop.
Application instance as singleton
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
public class MyApp extends MultiDexApplication { | |
private static MyApp sInstance = null; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
sInstance = this; | |
} | |
public static MyApp getInstance() { | |
return sInstance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment