Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教如何设置点击回退回到上一级页面? #15

Closed
jianfengye opened this issue Oct 1, 2015 · 2 comments
Closed

请教如何设置点击回退回到上一级页面? #15

jianfengye opened this issue Oct 1, 2015 · 2 comments

Comments

@jianfengye
Copy link

参考代码,我理解只要维护一个回退的堆栈就可以在点击back健的时候设置回到上个activity?

// 设置回退的堆栈
var _navigator;
BackAndroid.addEventListener('hardwareBackPress', function() {
    if (_navigator && _navigator.getCurrentRoutes().length > 1) {
        _navigator.pop();
        return true;
    }
    return false;
});

但是我设置了之后发现点击back都是退出app,@race604,能不能大致说下这种回退返回上一页是怎么做的?

@race604
Copy link
Owner

race604 commented Oct 1, 2015

@jianfengye
Copy link
Author

谢谢,弄出来了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants