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

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -