Last active
July 31, 2017 16:27
-
-
Save caseykulm/c1cea230fb021e6c31975679573484e8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 App extends Application { | |
private AppComponent appComponent; | |
@Override | |
public void onCreate() { | |
appComponent = DaggerAppComponent | |
.module1(new Module1()) | |
.etcModule(new EtcModule()) | |
.build(); | |
} | |
private static App get(Context context) { | |
return (App) context.getApplicationContext(); | |
} | |
public static AppComponent getAppComponent(Context context) { | |
return get(context).appComponent; | |
} | |
} |
This file contains hidden or 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 SomeActivity extends AppCompatActivity { | |
@Override | |
public void onCreate(Bundle bundle) { | |
App.get(this) | |
.inject(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment