Search in sources :

Example 1 with BrowserSession

use of net.rim.blackberry.api.browser.BrowserSession in project google-authenticator by google.

the class AuthenticatorScreen method makeMenu.

/**
 * {@inheritDoc}
 */
protected void makeMenu(Menu menu, int instance) {
    super.makeMenu(menu, instance);
    MenuItem enterKeyItem = new MenuItem(sResources, ENTER_KEY_MENU_ITEM, 0, 0) {

        public void run() {
            pushScreen(new EnterKeyScreen());
        }
    };
    MenuItem termsItem = new MenuItem(sResources, TERMS_MENU_ITEM, 0, 0) {

        public void run() {
            BrowserSession session = Browser.getDefaultSession();
            session.displayPage(TERMS_URL);
        }
    };
    MenuItem privacyItem = new MenuItem(sResources, PRIVACY_MENU_ITEM, 0, 0) {

        public void run() {
            BrowserSession session = Browser.getDefaultSession();
            session.displayPage(PRIVACY_URL);
        }
    };
    menu.add(enterKeyItem);
    if (!isTimerSet()) {
        MenuItem refreshItem = new MenuItem(sResources, REFRESH_MENU_ITEM, 0, 0) {

            public void run() {
                refreshUserList();
            }
        };
        menu.add(refreshItem);
    }
    if (mUpdateAvailable) {
        MenuItem updateItem = new MenuItem(sResources, UPDATE_NOW, 0, 0) {

            public void run() {
                BrowserSession session = Browser.getDefaultSession();
                session.displayPage(Build.DOWNLOAD_URL);
                mStatusText.setText("");
            }
        };
        menu.add(updateItem);
    }
    menu.add(termsItem);
    menu.add(privacyItem);
}
Also used : BrowserSession(net.rim.blackberry.api.browser.BrowserSession) MenuItem(net.rim.device.api.ui.MenuItem)

Aggregations

BrowserSession (net.rim.blackberry.api.browser.BrowserSession)1 MenuItem (net.rim.device.api.ui.MenuItem)1