Skip to content

Instantly share code, notes, and snippets.

@tylergets
Created March 1, 2017 22:32
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 tylergets/cb3689fa0455f84e5547f104592cf999 to your computer and use it in GitHub Desktop.
Save tylergets/cb3689fa0455f84e5547f104592cf999 to your computer and use it in GitHub Desktop.
Application instance as singleton
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