Dagger2 Custom Scopes : How do custom-scopes (@ActivityScope) actually work?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am reading the source code for Dagger2 Component Scopes Test on GitHub, and I've seen a "custom scope" defined for activities called @ActivityScope , but I've seen it in other projects including the 4-module CleanArchitecture that has its @PerActivity scope. But literally, the code for the @ActivityScope annotation is the following: import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import javax.inject.Scope; /** * Created by joesteele on 2/15/15. */ @Scope @Retention(RetentionPolicy.RUNTIME) public