Naviganto
Naviganto copied to clipboard
Navigate back to the previous view
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.
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.
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 ?