mirror of
https://github.com/MinimalBible/MinimalBible-Legacy
synced 2024-11-12 19:18:34 -05:00
Dynamically create the ObjectGraph, rather than onCreate()
This commit is contained in:
parent
2e8974b745
commit
78997f704f
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user