@Inject Lazy<User> lazyUser; //注入Lazy元素 @Inject Provider<User> providerUser; //注入Provider元素 public void init() { DaggerComponent.create().inject(this); User user1 = lazyUser<
Dagger2之Lazy和Provider(懒加载)-第六章
最新推荐文章于 2024-07-15 09:46:50 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
@Inject Lazy<User> lazyUser; //注入Lazy元素 @Inject Provider<User> providerUser; //注入Provider元素 public void init() { DaggerComponent.create().inject(this); User user1 = lazyUser<