mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
701 B
Java
29 lines
701 B
Java
package org.tasks.injection;
|
|
|
|
import android.os.Bundle;
|
|
import android.support.v7.app.ActionBarActivity;
|
|
|
|
import dagger.ObjectGraph;
|
|
|
|
public class InjectingActionBarActivity extends ActionBarActivity implements Injector {
|
|
private ObjectGraph objectGraph;
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
objectGraph = ((Injector) getApplication()).getObjectGraph().plus(new ActivityModule(this, this));
|
|
inject(this);
|
|
|
|
super.onCreate(savedInstanceState);
|
|
}
|
|
|
|
@Override
|
|
public void inject(Object caller) {
|
|
objectGraph.inject(caller);
|
|
}
|
|
|
|
@Override
|
|
public ObjectGraph getObjectGraph() {
|
|
return objectGraph;
|
|
}
|
|
}
|