I am trying to go back back to the previous page after loading a browser but it takes three back clicks to do so. I tried overriding the back button click but it still takes three clicks. I used following code to load the browser:
BrowserSession browserSession;
browserSession = Browser.getDefaultSession();
try{
browserSession.displayPage(mapLocation);
}catch(Exception e){
e.printStackTrace();
}
EDIT copied from answer by user:
I want to go to the previous screen not the previous page in the browser. The code for the back button :
protected boolean keyDown(int keycode, int status) {
if(Keypad.key(keycode) == Keypad.KEY_ESCAPE) {
_theApp.popScreen(this);
return true;
}
return false;
}