开发者

Problems with sequence of activity screens

开发者 https://www.devze.com 2023-02-14 07:46 出处:网络
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 (logi

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 c开发者_如何学Goan 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?


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)) {
} 
0

精彩评论

暂无评论...
验证码 换一张
取 消