Dynamically create the ObjectGraph, rather than onCreate()

This commit is contained in:
Bradlee Speice 2014-06-05 21:00:15 -04:00
parent 2e8974b745
commit 78997f704f

View File

@ -49,8 +49,8 @@ public class MinimalBible extends Application {
*/ */
@Override @Override
public void onCreate() { public void onCreate() {
graph = ObjectGraph.create(MinimalBibleModules.class); //TODO: Is this necessary?
graph.inject(this); inject(this);
} }
/** /**
@ -58,6 +58,9 @@ public class MinimalBible extends Application {
* @param o The object to be injected * @param o The object to be injected
*/ */
public void inject(Object o) { public void inject(Object o) {
if (graph == null) {
graph = ObjectGraph.create(MinimalBibleModules.class);
}
graph.inject(o); graph.inject(o);
} }