Last active
December 17, 2015 03:19
-
-
Save windless/5541978 to your computer and use it in GitHub Desktop.
Java: Dagger application
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 Application extends Application { | |
private static ObjectGraph objectGraph; | |
public static <T> static inject(T instance) { | |
objectGraph.inject(instance); | |
} | |
@Override | |
public void OnCreate() { | |
super.OnCreate(); | |
objectGraph = ObjectGraph.create(new AndroidModule(this)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment