Git Product home page Git Product logo

Comments (6)

codeestX avatar codeestX commented on May 19, 2024

@duchao Hello,这两个get方法的确没用到,在component中可以不写,ContextLife是一个dagger2的Qualifier注解,用来给同类型的构造器打Tag来区别的,目前暂时没有用到,也可以不标注的。这个bug我会去看下的,感谢反馈哈

from geeknews.

caopeng000 avatar caopeng000 commented on May 19, 2024

请问一下,你是怎么切换不同的HOST的,我现在有两个不同的HOST,我使用了和你类似的代码,好像一直只能初始化一个HOST,是不是我还要注意其他的东西。谢谢

from geeknews.

codeestX avatar codeestX commented on May 19, 2024

Hi @caopeng000 ,我为每个不同的HOST都创建了一个Retrofit,用Qualifier来区分这些Retrofit,可以看下这个类HttpModule

from geeknews.

caopeng000 avatar caopeng000 commented on May 19, 2024

这个我知道。我也是这样写的。但是有且只能识别一个,还有其他原因吗

from geeknews.

codeestX avatar codeestX commented on May 19, 2024

@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.

caopeng000 avatar caopeng000 commented on May 19, 2024

好了。谢谢。没匹配上。提供方写的都是同一个地址

from geeknews.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.