Skip to content

Instantly share code, notes, and snippets.

@frogermcs
Created April 16, 2016 21:37
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 frogermcs/83d9f38a57826d637eaff3353c716ca2 to your computer and use it in GitHub Desktop.
Save frogermcs/83d9f38a57826d637eaff3353c716ca2 to your computer and use it in GitHub Desktop.
Async injection with Dagger 2 and RxJava
public class SplashActivity extends BaseActivity {
@Inject
SplashActivityPresenter presenter;
@Inject
AnalyticsManager analyticsManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
//This method is called in super.onCreate() method
@Override
protected void setupActivityComponent() {
final SplashActivityComponent splashActivityComponent = GithubClientApplication.get(SplashActivity.this)
.getAppComponent()
.plus(new SplashActivityModule(SplashActivity.this));
splashActivityComponent.inject(SplashActivity.this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment