Hi All,
I'm testing the possibility of cyclic dependencies for transfuse.
Unfortunately my project has a lot of them. And it works quite well with dagger v1.
I've created a set of classes and looks like app not able to resolve that. It hangs on starting.
My classes:
public class Example {
}
@Singleton
public class MainObject {
public final Example mExample;
public final Provider<ComplexObject> mComplexObjectProvider;
@Inject
public MainObject(Example example, Provider<ComplexObject> complexObjectProvider) {
mExample = example;
mComplexObjectProvider = complexObjectProvider;
}
@Override
public String toString() {
return super.toString() + ", mExample: " + mExample + ", mComplexObject: " + mComplexObjectProvider.get();
}
}
@Singleton
public class ComplexObject {
public final Provider<MainObject> mMainObjectProvider;
@Inject
public ComplexObject(Provider<MainObject> mainObjectProvider) {
mMainObjectProvider = mainObjectProvider;
}
@Override
public String toString() {
return super.toString() + ", mMainObject: " + mMainObjectProvider.get();
}
}
And finally in activity I do print all injected members:
@org.androidtransfuse.annotations.Activity
@Layout(R.layout.activity_main)
public class Main {
@Inject
Example mExample;
@Inject
MainObject mMainObject;
@Inject
ComplexObject mComplexObject;
@OnCreate
public void doSomethingElse(){
Log.d("MainActivity", "mExample: " + mExample);
Log.d("MainActivity", "mMainObject: " + mMainObject);
Log.d("MainActivity", "mComplexObject: " + mComplexObject);
}
}
But in log cat I could observe only log line from mExample
Am I doing something wrong?
Regards,