-
Notifications
You must be signed in to change notification settings - Fork 228
自定义路由表
Half Stack edited this page Jun 16, 2017
·
4 revisions
如果不想使用注解的方式来映射路由,也可以使用代码自定义。
// 动态添加路由表
Router.handleRouteTable(new RouteTable() {
@Override
public void handle(Map<String, Class<?>> map) {
map.put("dynamic1", TestActivity.class);
map.put("dynamic2", TestFragment.class);
...
}
});
该方式与注解没有冲突,可以同时使用,且可以调用多次,方便协作开发。