static Page find(final long pageId) {
            for (Page page : Page.values()) {
                if (page.id == pageId) {
                    return page;
                }
            }
            return null;
        }
Enum of all possible pages with methods to get the view and a title.
main/src/main/java/cgeo/geocaching/CacheDetailActivity.java