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

Navigate back to the previous view #10

Open
nelo686 opened this issue Nov 22, 2016 · 2 comments
Open

Navigate back to the previous view #10

nelo686 opened this issue Nov 22, 2016 · 2 comments
Assignees

Comments

@nelo686
Copy link

nelo686 commented Nov 22, 2016

More than an issue it is a doubt. Maybe it's too obvious, but I didn't get it right. I did a couple of tries to come back to the previous view, like:

ConceptRouter.get().back(context);

or

((StartActivity) context).onBackPressed();

or

ConceptRouter.get().routeTo(context, new Route(StartRoute.class, new Bundle()));

but I don't want to create a new view, I want to retrieve the one already exists.

By the way, also I put this in my activity

@Override
    public void onBackPressed() {
        if (!ConceptRouter.get().back(this))
            super.onBackPressed();
    }

But I don't know why, even when there is a view history, always goes into the if.

Can you help me?
Thxs.

@FireZenk
Copy link
Owner

FireZenk commented Nov 23, 2016

The way that Naviganto works is to save a history of Route's, that is, every view is recreated with their params, but the are no state (I'm working on this viewState's idea).
May you need some util to save the states in the meantime.

@FireZenk FireZenk self-assigned this Nov 23, 2016
@jemshit
Copy link

jemshit commented Dec 28, 2016

In sample app, when i do HomeActivity->InfoView->DetailActivity->HomeActivity->InfoView, then start pressing Back button, it goes all backwards opening every view. How to handle if i want to stop going back when i am at HomeActivity ?

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

3 participants