Closed DylanCaiCoding closed 1 year ago
如果用 ARouter,一个接口有多个实现类, 可以用 path 去决定使用哪个。
@Route(path = "/test/helloworld") public class HelloWorldServiceImpl implements HelloService { @Override public String sayHello() { return "hello, world!"; } @Override public void init(Context context) { } } @Route(path = "/test/helloandroid") public class HelloAndroidServiceImpl implements HelloService { @Override public String sayHello() { return "hello, android!"; } @Override public void init(Context context) { } }
helloService1 = (HelloService) ARouter.getInstance().build("/test/helloworld").navigation(); helloService2 = (HelloService) ARouter.getInstance().build("/test/helloandroid").navigation();
那么用 TheRouter 该如何实现该需求?看文档没有相关的示例。
请查看 【1.3 服务提供方】章节的内容: https://therouter.cn/docs/2022/08/27/01
如果用 ARouter,一个接口有多个实现类, 可以用 path 去决定使用哪个。
那么用 TheRouter 该如何实现该需求?看文档没有相关的示例。