Dynamically create the ObjectGraph, rather than onCreate()

ugly-unit-test
Bradlee Speice 2014-06-05 21:00:15 -04:00
parent 2e8974b745
commit 78997f704f
1 changed files with 5 additions and 2 deletions

View File

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