views:

30

answers:

1

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;
}
A: 

I want to go to the previous screen not the previous page in the browser. The code for back button :

protected boolean keyDown(int keycode, int status) {
  if(Keypad.key(keycode) == Keypad.KEY_ESCAPE) {
      _theApp.popScreen(this);
      return true;
  }
  return false;
}
Editing your question, or adding a comment are the preferred ways of providing more information, rather than creating an answer that isn't really an answer.
Michael Donohue