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

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -