java - Is it possible to scope constructor injection in dagger 2? -
i have code , want make scoped. found not working , seems possible through in module. wasn't able find proper question , possible scope constructor injection?
does not work
@appscope @inject public stackoverflow() { }
scope works!!
@module public internetmodule { @appscope @provides public stackoverflow providestackoverflow() { return new stackoverflow(); } }
you need put scope on class
@appscope public class blah { @inject stackoverflow stackoverflow; @inject public blah() { } }
Comments
Post a Comment