Skip to content

Instantly share code, notes, and snippets.

@mohsenoid
Last active February 4, 2018 17:13
Show Gist options
  • Save mohsenoid/5c8378bc503dba0c5457d86d4d26ebff to your computer and use it in GitHub Desktop.
Save mohsenoid/5c8378bc503dba0c5457d86d4d26ebff to your computer and use it in GitHub Desktop.
package com.mirhoseini.marvel;
import android.app.Application;
public abstract class MarvelApplication extends Application {
private static ApplicationComponent component;
public static ApplicationComponent getComponent() {
return component;
}
@Override
public void onCreate() {
super.onCreate();
initApplication();
component = createComponent();
}
public ApplicationComponent createComponent() {
return DaggerApplicationComponent.builder()
.androidModule(new AndroidModule(this))
.build();
}
public abstract void initApplication();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment