Skip to content

Instantly share code, notes, and snippets.

@yayaa
Last active October 28, 2017 17:21
Show Gist options
  • Save yayaa/e64497c9c3a20e16ab8b21cf2f69cb63 to your computer and use it in GitHub Desktop.
Save yayaa/e64497c9c3a20e16ab8b21cf2f69cb63 to your computer and use it in GitHub Desktop.
public class SimpleApplication extends Application {
@Inject CoolAnalyticsTool coolAnalyticsTool;
@Inject ImageLoaderConfiguration imageLoaderConfiguration;
@Inject ImageLoader imageLoader;
@Override
public void onCreate() {
super.onCreate();
ApplicationComponent.create(this).inject(this);
imageLoader.init(imageLoaderConfiguration);
coolAnalyticsTool.configure(this);
importantMethod();
PerformanceTool.monitor(this);
SomeUtilObject.init(this);
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/some_font_path.ttf")
.setFontAttrId(android.R.attr.fontFamily)
.build());
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
LeakCanary.install(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment