@Override public void onSuccess(RoutesBean routesBean) { List<RouteBean> routes = routesBean.getRoutes(); if (routes.size() == 1) { RouteBean route = routes.get(0); System.out.println("route found: " + route.getShortName() + " " + route.getLongName()); _service.getStopsForRoute(route.getId(), new StopsForRouteHandler(route)); } else { TabBarController rootController = MobileApplicationContext.getRootController(); rootController.setSelectedIndex(0); } }
public static void searchForRoute(String route) { switchToMapView(); CoordinateBounds bounds = getSearchBounds(20 * 1000); SearchQueryBean query = new SearchQueryBean(); query.setQuery(route); query.setMaxCount(10); query.setBounds(bounds); query.setType(EQueryType.BOUNDS_OR_CLOSEST); _service.getRoutes(query, new RoutesHandler()); }