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

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

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

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -