Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 18
Registered: ‎08-23-2012
My Device: Blackberry 9990
My Carrier: -

Problem when i try press back button on browser

Hi i'm luis. 

 

When i press the back button the browser close and show me a white page

i'm trying to cancel the back button but doesn't work

this is the code

 

public class openWWW extends MainScreen {
boolean aFlag;

public openWWW(boolean hd) {
BrowserSession browser = Browser.getDefaultSession();
browser.displayPage(pageWeb);
}

protected boolean keyDown(int keycode, int time) {
if (Keypad.key(keycode) == Keypad.KEY_ESCAPE) {
return false;
}
return false;
}

public boolean onClose() {
return true;
}

private void error(final String message) {
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
Dialog.alert(message);
}
});
}
}