Comments (6)
@duchao Hello,这两个get
方法的确没用到,在component
中可以不写,ContextLife
是一个dagger2的Qualifier
注解,用来给同类型的构造器打Tag来区别的,目前暂时没有用到,也可以不标注的。这个bug我会去看下的,感谢反馈哈
from geeknews.
请问一下,你是怎么切换不同的HOST的,我现在有两个不同的HOST,我使用了和你类似的代码,好像一直只能初始化一个HOST,是不是我还要注意其他的东西。谢谢
from geeknews.
Hi @caopeng000 ,我为每个不同的HOST都创建了一个Retrofit
,用Qualifier
来区分这些Retrofit
,可以看下这个类HttpModule
from geeknews.
这个我知道。我也是这样写的。但是有且只能识别一个,还有其他原因吗
from geeknews.
@caopeng000 没有具体代码的话我只能猜原因了..比如依赖的提供方和接收方都要标注相同的Qualifier
@Singleton
@Provides
@VtexUrl
Retrofit provideVtexRetrofit(Retrofit.Builder builder, OkHttpClient client) {
return createRetrofit(builder, client, VtexApis.HOST);
}
@Singleton
@Provides
VtexApis provideVtexService(@VtexUrl Retrofit retrofit) {
return retrofit.create(VtexApis.class);
}
或者看下Dagger2编译后生成的代码,从里面找原因
from geeknews.
好了。谢谢。没匹配上。提供方写的都是同一个地址
from geeknews.
Related Issues (20)
- 闪退
- UTC时间转换错误
- 加载详情页时总报这个错ERROR:interface_registry.cc(104)
- 关于RealmHelper的疑问 HOT 1
- 添加header
- 封装的Root基类里面加载动画
- 关于使用Dagger2注入presenter的问题 HOT 1
- 关于HttpModule类中,构建Retrofit对象的问题
- 关键类缺失
- emitter.onNext内代码发生异常,却不回调CommonSubscriber的onError
- App里边不会有相同的两个Activity吧, 为啥还要用HashSet 去重呢?
- How to createData when data is null
- 动态更换请求HOST
- android resource linking failed
- Performance improvement suggestion
- apk
- apk连接挂了,可以给个apk么 [email protected] 给star哦!
- 缺少DaggerActivityComponent等源文件
- download link is 404 HOT 1
- Awesome
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geeknews.