Naviganto icon indicating copy to clipboard operation
Naviganto copied to clipboard

Navigate back to the previous view

Open nelo686 opened this issue 8 years ago • 2 comments

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.

nelo686 avatar Nov 22 '16 20:11 nelo686

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 avatar Nov 23 '16 15:11 FireZenk

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 ?

jemshit avatar Dec 28 '16 12:12 jemshit