Back to project page mvp-notes.
The source code is released under:
Apache License
If you think the Android project mvp-notes listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.corneliudascalu.mvpnotes; /*from ww w. j ava 2 s . co m*/ import com.corneliudascalu.mvpnotes.common.ObjectGraphCreator; import com.corneliudascalu.mvpnotes.common.ObjectGraphHolder; import android.app.Application; import java.util.Arrays; import java.util.List; import dagger.ObjectGraph; /** * @author Corneliu Dascalu <corneliu.dascalu@gmail.com> */ public class MVPNotesApp extends Application { @Override public void onCreate() { super.onCreate(); ObjectGraphHolder.setObjectGraphCreator(new ObjectGraphCreator() { @Override public ObjectGraph create(Application application) { return ObjectGraph.create(getModules().toArray()); } }); } /** * The list of modules containing application-level stuff */ private List<Object> getModules() { return Arrays.<Object>asList(new AppModule(this)); } /** * Create a scoped object graph by adding some modules to the app modules */ public ObjectGraph createScopedObjectGraph(Object... modules) { return ObjectGraphHolder.getObjectGraph(this).plus(modules); } }