0

everyone. 1) I've always thought that if I leave my app through Home button and then launch it again in menu, then I will return to the last activity on the stack. But in my case first activity (login screen) is opened. How can I change this behaviour? 2) If I open browser from my app and inside browser click Return button, it doesn't go back to my app, but goes to the previous page... Anybody knows how to fix it?

Konstantin Milyutin
  • 11,946
  • 11
  • 59
  • 85
  • check if you are finishing the activity when you call on web browser , and in onpause method. if its true then remove that.. – Ganapathy C Mar 03 '11 at 08:03

1 Answers1

1

1) If you leave your app it is stopped and it could be destroyed or not depending whether device needs to free resources (memory) or not. Maybe your browser needs so much memory that dalvik kills your activity. It's further explained on: http://developer.android.com/reference/android/app/Activity.html

2) You can change action bind to return button in your case probably your browser override this button to go to the previous page.

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if ((keyCode == KeyEvent.KEYCODE_BACK)) {
} 
zirael
  • 1,137
  • 10
  • 21
  • http://stackoverflow.com/questions/2000102/android-override-back-button-to-act-like-home-button - Here you have solution how to prevent that (by creating service) – zirael Mar 03 '11 at 08:49