Skip to content

Instantly share code, notes, and snippets.

Created April 16, 2016 21:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Async injection with Dagger 2 and RxJava
protected void setupActivityComponent() {
Observable.create(new Observable.OnSubscribe<Object>() {
public void call(Subscriber<? super Object> subscriber) {
final SplashActivityComponent splashActivityComponent = GithubClientApplication.get(SplashActivity.this)
.plus(new SplashActivityModule(SplashActivity.this));
.subscribe(new SimpleObserver<Object>() {
public void onCompleted() {
//Here is the moment when injection is done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment