Created
November 29, 2017 00:55
-
-
Save larkintuckerllc/6d30f68bef90a8ebf4443af56b6f322d to your computer and use it in GitHub Desktop.
How-to Dagger 2 with Android: Part 2 - 2
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 MyApplication extends Application { | |
private MyComponent mMyComponent; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
mMyComponent = createMyComponent(); | |
} | |
MyComponent getMyComponent() { | |
return mMyComponent; | |
} | |
private MyComponent createMyComponent() { | |
return DaggerMyComponent | |
.builder() | |
.myModule(new MyModule()) | |
.build(); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment