From 78997f704f6734b5b97d388ed907f6d65751bc0c Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Thu, 5 Jun 2014 21:00:15 -0400 Subject: [PATCH] Dynamically create the ObjectGraph, rather than onCreate() --- .../main/java/org/bspeice/minimalbible/MinimalBible.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MinimalBible/src/main/java/org/bspeice/minimalbible/MinimalBible.java b/MinimalBible/src/main/java/org/bspeice/minimalbible/MinimalBible.java index 70bfd31..d85c32c 100644 --- a/MinimalBible/src/main/java/org/bspeice/minimalbible/MinimalBible.java +++ b/MinimalBible/src/main/java/org/bspeice/minimalbible/MinimalBible.java @@ -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); }