public MobileApplication() {
TabBarController tabs = MobileApplicationContext.getRootController();
NavigationController maps = createNavigationController("map", "Map",
_resources.getCrossHairsIcon(),
MobileApplicationContext.getMapViewController());
NavigationController bookmarks = createNavigationController("bookmarks",
"Bookmarks", _resources.getBookmarksIcon(),
new BookmarksViewController());
NavigationController recentStops = createNavigationController("recent",
"Recent", _resources.getClockIcon(), new RecentStopsViewController());
NavigationController search = createNavigationController("search",
"Search", _resources.getMagnifyingGlassIcon(),
new SearchViewController());
tabs.addViewController(maps);
tabs.addViewController(bookmarks);
tabs.addViewController(recentStops);
tabs.addViewController(search);
tabs.addVieControllerSelectedHandler(new ViewControllerSelectedHandler() {
@Override
public void handleViewControllerSelected(ViewControllerSelectedEvent event) {
NavigationController nav = (NavigationController) event.getViewController();
nav.popToRootViewController();
}
});
setRootViewController(tabs);