Java – BlackBerry browser return Click
•
Java
After loading the browser, I want to go back to the previous page, but it takes three clicks I tried to override the back button, but still needed three clicks I use the following code to load the browser:
BrowserSession browserSession;
browserSession = Browser.getDefaultSession();
try{
browserSession.displayPage(mapLocation);
}catch(Exception e){
e.printStackTrace();
}
Edit copy from user reply:
I want to go to the previous screen, not the previous page in the browser Code of the back button:
protected boolean keyDown(int keycode,int status) {
if(Keypad.key(keycode) == Keypad.KEY_ESCAPE) {
_theApp.popScreen(this);
return true;
}
return false;
}
Solution
To return to the previous page, you can try the following:
UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());
I hope it will be helpful
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码
