Created
November 27, 2017 01:13
-
-
Save larkintuckerllc/c6a4310944ca01fa066973f1a004151f to your computer and use it in GitHub Desktop.
How-to Dagger 2 with Android: Part 1 - 10
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
import android.app.Application; | |
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